.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 "/?".
精彩评论