redirect http://*.olddomain.com to https://*.old-domain.com

Using a single web hosting account to host multiple sites

redirect http://*.olddomain.com to https://*.old-domain.com

Postby csgonan » Tue Jun 09, 2009 9:49 am

I need to redirect all references to *.olddomain.com to https://*.old-domain.com (with a dash). The site is a wildcard and they can enter anything for * so they have to not lose the vaue of * when redirecting.

I also need to redirect all references of http://*.old-domain.com to https://*.old-domain.com. Again I do not want to lose the value of * that they typed in.

I can do this with redirect or rewrite, whichever is easier please.

Thank you
csgonan
 
Posts: 1
Joined: Tue Jun 09, 2009 9:36 am

Postby richardk » Tue Jun 09, 2009 3:21 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} ^(.+\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ https://%1old-domain.com/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 4 guests

cron