【发布时间】:2010-03-14 03:05:51
【问题描述】:
我正在尝试将 /website/folder/ 目录中的所有内容重定向到单个页面。
我用这个简单的代码添加了一个简单的 .htaccess(我知道这需要 .htaccess 中的更多代码,但这只是一个测试)。
RewriteEngine on
RewriteRule .* index.php [NC,L]
当我尝试时:
http://127.0.0.1:8888/website/folder/fileDoesntExistMustGoIndex
我有一个“找不到对象 404”错误和 access.log 显示:
127.0.0.1 - - [13/Mar/2010:13:48:31 -0500] "GET /website/folder/fileDoesntExistMustGoIndexHTTP/1.1" 404 1118
我检查了 httpd.conf 并没有发现任何可以改变这个 .htaccess 语句的东西。有什么想法吗?
编辑:
RewriteEngine on
RewriteRule .* http://www.google.ca [NC,L]
这可行...但当我尝试重写我的页面时却不行。
【问题讨论】:
标签: php apache .htaccess mod-rewrite url-rewriting