Multiple domains to one secured HTTPS domain

Fix it!!

Multiple domains to one secured HTTPS domain

Postby squeezer » Fri Aug 24, 2007 6:06 am

Hello everybody.
I have some domains:,, ...
These domains all point to the same IP adress and are aliases for

Now I want to redirect all the domains to

I am new to mod_rewrite and I have already read some threads in this forum, but I didn't exactly found what I was looking for.

I need to do this, because I have one SSL certificate for, and I do not want to get certificate missmatches if a user goes to for example.

Thanks for your help!

Posts: 1
Joined: Fri Aug 24, 2007 6:01 am

Postby richardk » Fri Aug 24, 2007 10:34 am

Do they all have the same document root?

Try the following in a .htaccess file in the document root(s)
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.abc\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?abc\.com$ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$$1 [R=301,L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 1 guest