I have rewriting enabled.
I go to domain/bar
and expect it to be rewritten to domain/index.php?foo=bar
but I get d开发者_StackOverflowomain/index.php?foo=index.php
instead :o
RewriteRule ^(.*)$ index.php?foo=$1
Why isn't $1
set to bar?
This works fine for me, try it:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?foo=$1
精彩评论