我目前在本地機器上運行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