是的,我知道这已被问了数百次。但我找不到实际可行的版本。目前,我目前使用的所有功能目前都在删除.php
,但那是问题出现的时间。我网站上的几个页面取决于$_GET
请求,例如profile
因此,当您访问url http://www.example.com/profile?username=System时,您将获得404,而没有?username=System
,则可以正常工作。当前的代码我已经是删除网址中的后缀
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
你有你的Al lowOrverride设置为全部?在xammp和http-conf中?还把选项索引FollowSymLinks包括ExecCGI在你的http.conf –
这是托管在远程服务器上,所以我不知道,但在我决定改变页面系统之前,重写像这样工作得很好。但是,然后页面由index.php完成?page = profile&username = System – ChocCookieRaider
由于规则集中的条件不匹配,显然没有文件夹'http://www.example.com/ profile?username = System'但是,哪个脚本应该获取传入URL中传递的参数。即'username = System',名为'profile'的脚本(profile.php)或另一个不在URL中的名称,如'index.php'? –