mod_rewrite not working fully?

  • Posted January 15, 2015

So I am using the following

<VirtualHost :80> RewriteEngine on ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.) https://%{HTTP_HOST}/$1 [NC,R,L] </VirtualHost> <VirtualHost *:443> etc…

and it does not redirect all traffic to the appropriate named version, it goes to SSL but not the domain setup. I am using only and not so my SSL cert is registered to and not the www version, and it does redirect to the SSL version but not to just the version. open to suggestions please?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Just to add, I have tried the following and it seems to work on IE. but not Chrome. <VirtualHost :80> RewriteEngine on RewriteCond %{HTTPHOST} !^$ [NC] ReWriteCond %{SERVERPORT} !^443$ RewriteRule ^/(.) https://%{HTTP_HOST}/$1 [NC,R,L] </VirtualHost>