+ -
当前位置:首页 → 问答吧 → 一个RewriteRule匹配了,却不起作用,极度不解中...

一个RewriteRule匹配了,却不起作用,极度不解中...

时间:2011-10-14

来源:互联网

RewriteRule ^(.*)/([A-Z])([^/]+)/([^/]+)/$ http://www.google.com
测试的 url:http://127.0.0.1:8008/BeiJing/FangChan/
提示:这个url和上面那个规则是匹配的,而且放在.htaccess所有规则的最上面.既然匹配了,那访问这个url时就要转到http://www.google.com,但是浏览器返回的是下面的错误信息:

Not Found
The requested URL /BeiJing/FangChan/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.0.63 (Win32) PHP/5.2.14 Server at 127.0.0.1 Port 8008

作者: cyhcyhhychyc   发布时间: 2011-10-14

#source url can not contain the host address!
RewriteRule ^([A-Z])([^/]+)/([^/]+)/$ http://www.google.com

作者: quickphp   发布时间: 2011-10-14

RewriteRule ^[/]?([A-Z])([^/]+)/([^/]+)/$ http://www.google.com

作者: lizyl   发布时间: 2011-10-14

相关阅读 更多