开发者

.htaccess rewrite rule fail,dont know why

I've such a rule in my .htaccess:

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

wh开发者_Python百科en I browser url "http://127.0.0.1:8008/BeiJing/FangChan/",the browser doestnt take me to google.com,but show me a 404 err page instead. dont know why.


Use this one instead, because your (.*)/ breaks it

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


Try this out:

RewriteRule ^([^/]+)/([^/]+)/?$

That'll match two levels deep, with or without a trailing slash. If you need to go deeper, you can just repeat the pattern, ending with a "/?".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜