我想检查请求URL是否为空,否则它将以/ test开头
极端:
如果我访问www.example.com,则应重定向到www.example.com/test
如果该网址已经具有www.abc.com/test,则无需重定向。
RewriteCond %{HTTP_HOST} example.com
RewriteCond %{REQUEST_URI} !/test
RewriteRule ^.*$ http://example.com/test/$1 [R=301,L,NC]
检查request_URL是否为空所需的任何修改?
RewriteCond %{HTTP_HOST} example\.com$
RewriteCond %{THE_REQUEST} !\s\/(?:test\/?)?\s
RewriteRule ^.*$ http://example.com/test/$0 [R=301,L,NC]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句