0

I have a domain that needs to be redirected in order to use a shared SSL certificate. I can redirect the domain no problem, the issue I have is the way this leaves the URL formatting i.e.:

http://www.example.com is redirecting to https://myhost.secure.com/www.example.com

I'm looking to hide the "myhost.secure.com/" part using htaccess but can't find a valid way to do it (I'm a complete novice, sorry). Redirect is being done via htaccess using code below:

RewriteEngine on RewriteBase / RewriteCond %{ENV:https} !=on RewriteRule ^(.*) https://myhost.secure.com/www.example.com/$1 [R,L]

How can I modify this to only display my domain and not the full redirected URL? The redirect works correctly, I see the site as it sits in the secure area of my FTP, but I don't want visitors to see the hosts redirect in the URL.

N. Beb
  • 1
  • 1
  • Possible duplicate of [htaccess redirect to https://www](https://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www) – besciualex Jun 04 '18 at 10:33
  • Basically you are asking for a permanent redirect to HTTPS whenever HTTP protocol is used. Check this link: https://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www – besciualex Jun 04 '18 at 10:33
  • I've tried the sample code in that thread, but it's made no difference. The redirect is already working fine, I just can't mask the URL to hide the first part of it. – N. Beb Jun 04 '18 at 10:44
  • I think we have a miss conception here. If I get you right then you are trying to use the https server listening on `myhost.secure.com` but have the URL show `www.example.com`... That is not possible obviously! It goes against the basic ideas of https. Things are different if that https server listens to the host name `www.example.com`, sure. That makes sense. Are you sure that is the case? – arkascha Jun 04 '18 at 10:52

0 Answers0