开发者

.htaccess rewrite rule fail,dont know why

开发者 https://www.devze.com 2023-04-12 04:44 出处:网络
I\'ve such a rule in my .htaccess: RewriteRule ^(.*)/([A-Z])([^\\/]+)/([^\\/]+)/$ http://www\\.google\\.com

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

精彩评论

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