我很抱歉,如果这很简单。我已经把它搞瞎了,但无济于事。.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