Apache RewriteRule .* index.php [NC,L] 不工作
我试图将所有内容从我的 /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]
这有效......但当我尝试重写我的页面时则无效。
I am trying to redirect everything to a single page from my /website/folder/ directory.
I added a simple .htaccess with this simple code (I know this would require more code in .htaccess but it's just a test).
RewriteEngine on
RewriteRule .* index.php [NC,L]
When I try :
http://127.0.0.1:8888/website/folder/fileDoesntExistMustGoIndex
I have an "Object not found 404" error and the access.log display:
127.0.0.1 - - [13/Mar/2010:13:48:31 -0500] "GET /website/folder/fileDoesntExistMustGoIndexHTTP/1.1" 404 1118
I have check the httpd.conf and I see nothing that could alter this .htaccess statement. Any idea?
Edit:
RewriteEngine on
RewriteRule .* http://www.google.ca [NC,L]
This works... but not when I try to rewrite to a page of mine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也尝试
看看会发生什么
also try
to see what happens