我在我的网页上有一个重写规则。我的RewriteRule有什么问题?它似乎没问题,但它不起作用
RewriteEngine On
RewriteRule ^(.*) index.php?p=$1 [L]
我希望它的工作,因此重写的URL是这样的:
http://example.com -> index.php
http://example.com/home -> index.php?p=home
http://example.com/lol -> index.php?p=lol
但是,当我用我的index.php里面下面的PHP代码
print_r($_GET)
它给出了这样的:
Array ([p] => index.php)
它给出了相同的结果在所有的URL(我试过这些:http://example.com
,http://example.com/
,http://example.com/about
,http://example.com/about/
你能帮我debig这个吗?
什么? 'mod_rewrite'离题在这里?我们甚至有一个标签维基! – 2013-05-02 10:56:22