【发布时间】:2009-11-07 05:17:11
【问题描述】:
如果这很简单,我深表歉意。我已经用谷歌搜索了它,但无济于事。
我正在运行 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.
所以问题是,我到底做错了什么?
非常感谢。
-和平
【问题讨论】:
标签: apache mod-rewrite ubuntu