我希望当我在浏览器中键入地址加载draft.php文件:本地主机:81/mvcdemo。我已经在我的.htaccess文件中添加以下代码:
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ draft.php?url=$1 [QSA,L]
我也改变Apache(httpd.config)文件以获得重写。那么,我做错了什么?
为什么不把它叫做index.php?无论如何,这通常被配置为默认加载。 –
@ some-non-descript-user我知道这一点。我只想弄清楚我的重写有什么问题? –
你的.htaccess似乎很好。仔细检查你的配置,也不要忘记在进行更改后重新启动Apache。检查[这篇文章](http://stackoverflow.com/questions/12272731/using-mod-rewrite-with-xampp-and-windows-7-64-bit)更多的帮助与配置。 – harris