Hi, I have a unique ip for one of my sites. This site uses SSL. When someone types http://theipaddress into their browsers they get a broken version of the site and an ssl error. My question is....how do I redirect someone from the ip to the url version of the web site using .htaccess. I was thinking that perhaps this would work... redirect 301 http://theipaddress https://%{HTTP_HOST} Code (markup): But it didnt. Any smart people out there who can help me with this?
If your host supports rewrite, something like this should work: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} Code (markup):
Nice try but that just forces https by redirecting https://theipaddress to https://theipaddress. The ssl cert is configured for the domain name, not ip address. What I am wanting to do is do https://theipaddress or http://theipaddress to https://thedomainname.com