subdomain page to be redirected to main domain page

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 29 Dec 2012, 03:39

subdomain page to be redirected to main domain page

11 Jun 2013, 03:38

Hello,
I have a site with 10 subdomains. I want that when a user clicks on the sign in link from subdoamin he has to land on the main domain sign in page. The following code does not work please help.

RewriteCond %{HTTP:Host} ^(?!www)([^.]+)\.mydomain\.com$
RewriteRule ^signin.asp$ http://www.mydoamain.com/signin.asp [NC,P]

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: subdomain page to be redirected to main domain page

11 Jun 2013, 08:50

Hello,

Lets try:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP:Host} !^www\.mydomain\.com$
RewriteCond %{HTTP:Host} ^[^.]+\.mydomain\.com$
RewriteRule ^signin\.asp$ http://www.mydoamain.com/signin.asp [NC,P]


If it doesn't work. PLease, make sure that proxying is working. In order to do so, you can create a testing rule that proxyes certain page to google.uk, for example.

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 18 guests