Mobile app version of vmapp.org
Login or Join
Debbie626

: Implement country and language redirects (US, CA, En and Fr) in IIS 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

@Debbie626

Posted in: #Iis7 #Url

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:

us_url.com (US) canada_url.ca/ca_en/ (Canadian English) 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. us_url.com/ca_en/canada.asp) but I want to make sure the URL is the Canadian one (e.g. canada_url.ca/ca_en/canada.asp) so it shows up properly in Google Analytics.

We're using IIS 7 and classic ASP.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Debbie626

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

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

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Check US" patternSyntax="Wildcard" stopProcessing="true">
<match url="www.us_url.com" />
<conditions>
<add input="{HTTP_URL}" pattern="/ca_en*" />
</conditions>
<action type="Redirect" url="http://www.canada_url.ca/ca_en/" />
</rule>
<rule name="Check US 2" patternSyntax="Wildcard" stopProcessing="true">
<match url="www.us_url.com" />
<conditions>
<add input="{HTTP_URL}" pattern="/ca_fr*" />
</conditions>
<action type="Redirect" url="http://www.canada_url.ca/ca_fr/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme