开发者

htaccess problem 404 not found

I have rewrite URL like following

RewriteCond %{HTTP_HOST} ^subdomain\.mydomain\.example$
RewriteRule (.*) /subdomain/$1 [L]

RewriteRule ^a/(.*开发者_如何学JAVA)/(.*)$ search.php?searchtext=$1&locationtext=$2 [NC]

And I want to call my page like

http://kolkata.mydomain.example/a/phptraining/Kolkata

But when page is opening this is saying 404 not found. I’m not understanding this error.


With this rule set only the first rule is probably applied but not the second. Try the first rule without L flag and consider a possible subdomain within the request path:

RewriteCond %{HTTP_HOST} ^subdomain\.mydomain\.example$
RewriteRule .* /subdomain/$0
RewriteRule ^([^/]+/)?a/([^/]+)/([^/]+)$ $1search.php?searchtext=$2&locationtext=$3 [NC]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜