redirect http://* to https://*

Using a single web hosting account to host multiple sites

redirect http://* to https://*

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

I need to redirect all references to * to https://* (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://* to https://* 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
Posts: 1
Joined: Tue Jun 09, 2009 9:36 am

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

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} ^(.+\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]
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