mod rewrite - How to check if REQUEST_URI is not empty in apache RewriteCond httpd.conf? -
in problem detecting empty request_uri apache mod_rewrite , mentioned can use
rewritecond %{request_uri} ^.$
or
rewritecond %{request_uri} "^/$"
i need check if not empty, redirect empty one(ignore string after http_host).
i tried
rewritecond %{request_uri} !"^/$" rewriterule .* http://%{http_host} [l,r=301]
but not work. caused endless loop.
also tried rewritecond %{request_uri} !^/$
rewritecond %{request_uri} !^\/$
rewritecond %{request_uri} "!^/$"
rewritecond %{request_uri} "!^\/$"
how just:
rewriterule ^/.+$ http://%{http_host} [l,r=301]
Comments
Post a Comment