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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -