【发布时间】:2012-09-23 20:44:16
【问题描述】:
我正在尝试使用带有 mod_rewrite 的 Apache2 进行简单的重定向。我已经在我的 Apache 中安装了该模块,并在 localhost/file1/file2/page.html 中设置了一个网页。我在我的 000-default 文件中写了这个:
RewriteEngine On
RewriteRule elegantdirectory/page.html file1/file2/page.html [L,NC]
所以现在如果我尝试访问 localhost/elegantdirectory/page.html,服务器应该会显示我在 file1/file2 中的 page.html。任何想法为什么它不起作用?
【问题讨论】:
标签: mod-rewrite ubuntu apache2