我目前在本地机器上运行Apache2,并安装了最新版本的Ubuntu。.htaccess中的RewriteRule无法正常工作
我想通过使用.htaccess文件获取基本的URL重写工作。
确实存在文件“http://localhost/page.php?=home”,位置“/ doesnotexist/home”不存在。
我希望在第二个请求时加载第一个页面。
我的.htaccess文件看起来是这样的:
RewriteEngine On
RewriteRule ^/doesnotexist/(.*)$ /page.php?p=$1
我的httpd.conf文件看起来是这样的:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
<Directory /var/www>
AllowOverride All
</Directory>
请注意,我的httpd.conf文件看起来正是这样,作为在我编辑它之前它是空的。
,我得到的结果是这样的:
Not Found
The requested URL /doesnotexist/home was not found on this server.
我用Google搜索日益生活****出这个问题,我从来没有得到比上述错误的任何其他。
如果有人有任何想法,我会非常感激。
感谢您的快速回答,但很抱歉,行为不变。 – riwalk 2010-02-03 18:01:16