Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a website that has two URLs (one for the US side and another for the Canadian side which is then broken into Canadian English and Canadian French). For the purposes of my question, I will write as:

  • www.us_url.com (US)
  • www.canada_url.ca/ca_en/ (Canadian English)
  • www.canada_url.ca/ca_fr/ (Canadian French)

To make sure people are on the correct site, what do I do if they go to the US URL with Canadian English content (e.g. www.us_url.com/ca_en/canada.asp) but I want to make sure the URL is the Canadian one (e.g. www.canada_url.ca/ca_en/canada.asp) so it shows up properly in Google Analytics.

We're using IIS 7 and classic ASP.

share|improve this question
up vote 1 down vote accepted

Using the URL rewrite module, you should be able to do something like this:

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="Check US" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="www.us_url.com" />
                        <add input="{HTTP_URL}" pattern="/ca_en*" />
                    <action type="Redirect" url="http://www.canada_url.ca/ca_en/" />
                <rule name="Check US 2" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="www.us_url.com" />
                        <add input="{HTTP_URL}" pattern="/ca_fr*" />
                    <action type="Redirect" url="http://www.canada_url.ca/ca_fr/" />
share|improve this answer
Thanks very much! – stephmoreland Jun 25 '12 at 16:38
You're welcome! – Hoff Jun 25 '12 at 16:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.