开发者

htaccess query_string and rewrite rule

hello guys I'm using this htaccess script to set search.php?q=sometng&type=all to search/sometng/

RewriteCond %{QUERY_STRING} q=(.*)&type=all

RewriteRule ^search\.php$  /search\/%1\/? [R=301,L]

it works succesfully BUT I GET 404 error!

I've tried to put

开发者_开发技巧
RewriteRule ^search/(.*)/$ search.php?q=$1&type=all

it returns Attempting to open is not going to end any time entered into a routing loop.

whats wrong with this?


Try something like:

RewriteRule ^search/([a-z][A-Z])/([a-z][A-Z])/$ /search.php?q=$1&type=$2


Try

RewriteRule ^search/([^/]+)/([^/]+)$ search.php?q=$1&type=$2 [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜