开发者

Why does rewrite rule ^(.*)$ set variable $1 to index.php

开发者 https://www.devze.com 2023-03-25 19:06 出处:网络
I have rewriting enabled. I go to domain/bar and expect it to be rewritten to domain/index.php?foo=bar

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
0

精彩评论

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