我很抱歉,如果這很簡單。我已經把它搞瞎了,但無濟於事。.htaccess mod_rewrite規則在Ubuntu中不起作用
我使用的是Ubuntu 9.04,Jaunty Jackelope和Apache2。經過很多麻煩,我終於啓用了 mod_rewrite,而我的.htaccess文件試圖做它的事情,但是失敗了。這是我的設置。
在/etc/apache2/conf.d/我有一個名爲apeace-public-html.conf的文件。其內容如下:
# makes /home/apeace/public_html/ available through /localhost/apeace
Alias /apeace /home/apeace/public_html/
而且在/ home/apeace /的public_html /我有以下.htaccess文件:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^test\.html$ index.html
而且在/ home/apeace /的public_html /我有一個文件名爲index.html,但我沒有名爲test.html的文件。在我看來,當我嘗試訪問http://localhost/apeace/test.html時,此重寫應顯示index.html。然而,這是錯誤我得到:
Not Found
The requested URL /home/apeace/public_html/index.html was not found on this server.
所以現在的問題是,在世界上我究竟做錯了什麼?
非常感謝。
-apeace
這工作。非常感謝。我不敢相信這很簡單。 – apeace 2009-11-07 05:31:18