Matching code with mod_rewrite
For my application, I want to match an URL with mod_rewrite such that the URL is passed directly to the file (index.php) through a GET request. This is my code:
RewriteEngine On
RewriteRule ^(.*)$ index.php?q=$1
However开发者_Go百科, it's not working, and it appears to indeterminately rewrite it as "index.php?q=index.php". Could anyone enlighten me on this issue? Thanks.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?q=$1 [L]
try this one example
精彩评论