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]
精彩评论