I want to have a nice URLs on my website, so I have added this line into .htaccess, but it's causing infinite loop开发者_如何转开发.
RewriteRule ^(.*)$ http://www.mydomain.com/pages/$1%{QUERY_STRING}.php
It should rewrite every URL and add "pages/" and ".php" extension but only FIRST TIME not like some kind of recursive function.
you don't need to pass the query string, that happens automatically.
see the documentation
other than that, try this
RewriteCond %{REQUEST_URI} !^/pages/$
RewriteRule ^(/.*)? http://www.mydomain.com/pages/$1 [L]
精彩评论