redirect pages with locale to a normal page

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 16 Jul 2012, 22:52

redirect pages with locale to a normal page

06 Aug 2012, 01:38

Hi,

We're receiving a lot of duplicate errors because of the locale of a page

1. http://www.masterpet.com/en-NZ/Dogs/
2. http://www.masterpet.com/en-AU/Dogs/
3. http://www.masterpet.com/Dogs/

The URLs listed above serve the same content.

Now how would I redirect http://www.masterpet.com/en-AU/Dogs/ and http://www.masterpet.com/en-NZ/Dogs/ to http://www.masterpet.com/Dogs/
We don't need the en-NZ and en-AU pages anymore so we want to get rid of it.

Please take note that the NZ and AU pages are not specific for the DOg page. It exists on all our pages.

So I'll need a formatted redirect or something.

e.g.
REDIRECT http://www.masterpet.com/en-NZ/* to http://www.masterpet.com/*
REDIRECT http://www.masterpet.com/en-AU/* to http://www.masterpet.com/*

Any help would be greatly appreciated.

Thanks.

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

Re: redirect pages with locale to a normal page

06 Aug 2012, 06:14

Hello,

Please, try using the following:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteRule ^en-NZ/(.*)$ /$1 [NC,R=301,L]
RewriteRule ^en-AU/(.*)$ /$1 [NC,R=301,L]


Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 6 guests