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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -