Mon
16
Apr '07
Rewrite HTTPS host
by Frank Spychalski filed under all

To rewrite https://domain.(com|net|org|de|…) to https://domain.com just use:

RewriteEngine On
RewriteCond %{HTTP_HOST} !domain.com
RewriteRule ^/(.*)$ https://domain.com/$1 [R]


2 Responses to “Rewrite HTTPS host”

  1. 1

    Hi, I have a domain which has been registered since 2003. I recently entered an incorrect address and added https . To my amazement a website displayed which is not mine. Have I been nobbled or is it just that someone has taken the https version of the domain?

    Dave Edwards (June 10th, 2007 at 23:19)
  2. 2

    Dave, there is no “https version of the domain”. I guess you are using a shared hosting service with multiple domains on one IP. And on the same server/IP your domain is located someone else is running a site with https. If you enter https://yourdomain the browser looks up the IP for your domain and connects to port 443 (https port) on this domain. But on 443 this other service is running…

    Frank Spychalski (June 23rd, 2007 at 19:53)

Any comments? Or questions? Just leave a Reply: