开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜