This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: 301 redirect specific URL patterns
Author
Message |
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 05 December 2011 at 3:56pm

We're using EPiServer CMS platform, and it supports multi
languages which in turn creates duplicate page contents
and titles for us.

Now, how can we do a 301 redirect for:
http://www.sydneyanimalhospitals.com.au/en
http://www.sydneyanimalhospitals.com.au/sv
to:
http://www.sydneyanimalhospitals.com.au/


I just want to remove the 'en' or the 'sv' from the URL.
A URL could be:
http://www.sydneyanimalhospitals.com.au/sn/dir1/dir2/defa
ult.aspx
and I need to redirect this to:
http://www.sydneyanimalhospitals.com.au/dir1/dir2/default
.aspx

Hope this makes sense.

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 06 December 2011 at 5:10pm

Just want to follow up my query just in case anyone knows
how to solve it. Thanks.

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 07 December 2011 at 4:32am

Hello,

You may try using:

RewriteEngine on
RewriteBase /
Rewriterule ^(sv|en|jp)/(.*)$ /$1 [NC,R=301,L]

Regards
Andrew
Back to Top
 
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 07 December 2011 at 4:34pm

I'm not sure what's happening, but I get this page error
(when I type http://www.sydneyanimalhospitals.com.au/sv for
example):

This web page has a redirect loop
The web page at
http://www.sydneyanimalhospitals.com.au/sv/?id= has
resulted in too many redirects. Clearing your cookies for
this site or allowing third-party cookies may fix the
problem. If not, it is possibly a server configuration
issue and not a problem with your computer.

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 08 December 2011 at 8:13am

Do you have any other rules in .htacces or httpd.conf?

Regards
Andrew
Back to Top
 
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 08 December 2011 at 3:27pm

Yes I do.


# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.86

## MULTI LANGUAGE REDIRECTS ##

## RewriteEngine on
## RewriteBase /
## RewriteCond %{HTTP_HOST}
^(?:www\.sydneyanimalhospitals.\.com\.au)$ [NC]
## Rewriterule ^(sv|en|jp)/(.*)$ /$1 [NC,R=301,L]

## MULTI LANGUAGE REDIRECTS ##

RewriteRule ^matraville$ /en/Our-Hospitals/Matraville-
vet-hospital/ [NC,R=301,L]
RewriteRule ^matraville/$ /en/Our-Hospitals/Matraville-
vet-hospital/ [NC,R=301,L]
RewriteRule ^innerwestvet$ /en/Our-Hospitals/Inner-west-
vet-hospital/ [NC,R=301,L]
RewriteRule ^innerwestvet/$ /en/Our-Hospitals/Inner-west-
vet-hospital/ [NC,R=301,L]
RewriteRule ^kellyvillevet$ /en/Our-Hospitals/Kellyville-
vet-hospital/ [NC,R=301,L]
RewriteRule ^kellyvillevet/$ /en/Our-
Hospitals/Kellyville-vet-hospital/ [NC,R=301,L]
RewriteRule ^newtownvet$ /en/Our-Hospitals/Newtown-vet-
hospital/ [NC,R=301,L]
RewriteRule ^newtownvet/$ /en/Our-Hospitals/Newtown-vet-
hospital/ [NC,R=301,L]
RewriteRule ^norwestvet$ /en/Our-Hospitals/Norwest-vet-
hospital/ [NC,R=301,L]
RewriteRule ^norwestvet/$ /en/Our-Hospitals/Norwest-vet-
hospital/ [NC,R=301,L]
# RewriteRule default.aspx
http://www.sydneyanimalhospitals.com.au [I,O,RP,L]
RewriteRule ^default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=301,L]
RewriteRule ^BehaviourforDogs/tabid/16826/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-Care/Pet-
behaviour-problems/Tips-for-dog-behaviour-problems/
[R=301,L]
RewriteRule
^BehaviourforDogs/BehaviourTipsforDogs/tabid/16827/Defaul
t\.aspx$ http://www.sydneyanimalhospitals.com.au/en/Pet-
Care/Pet-behaviour-problems/Tips-for-dog-behaviour-
problems/ [R=301,L]
RewriteRule
^AdiposeStemCellTechnology/tabid/22842/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-
Care/Special-Veterinary-Services/Stem-cell-therapy-for-
dogs/ [R=301,L]
RewriteRule ^PetTools/PickaPet/tabid/17145/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-
Blog/Picking-a-Pet/ [R=301,L]
RewriteRule
^PetTools/PickaPet/PickaDog/tabid/17147/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-
Blog/Picking-a-Pet/ [R=301,L]
RewriteRule ^Home/tabid/15327/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=301,L]
RewriteRule ^InjuredWildlife/tabid/15496/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-
Care/Helping-Injured-Wildlife/ [R=301,L]
RewriteRule
^InnerWestArticles/InnerWestCatBoarding/tabid/16834/Defau
lt\.aspx$ http://www.sydneyanimalhospitals.com.au/en/Pet-
Blog/Cat-Boarding/ [R=301,L]
RewriteRule
^BehaviourforDogs/BehaviourCanineDeliquents/tabid/16828/D
efault\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-Care/Pet-
behaviour-problems/Tips-for-dog-behaviour-problems/
[R=301,L]
RewriteRule ^InnerWestArticles/tabid/16830/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-
Blog/Inner-West---Herbal-Medicine-in-Animals/ [R=301,L]
RewriteRule
^PetTools/PickaPet/PickaCat/tabid/17146/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-
Blog/Picking-a-Cat/ [R=301,L]
RewriteRule ^NewtownArticles/tabid/16831/Default\.aspx$
http://www.sydneyanimalhospitals.com.au/en/Pet-
Blog/Sydney-Animal-Hospitals---Newtown-Hospital-Articles-
--Click-the-Titles-Below-to-go-to-the-respective-Article/
[R=301,L]
RewriteRule
^InnerWestArticles/PuppiesKittens/tabid/16832/Default\.as
px$ http://www.sydneyanimalhospitals.com.au/en/Pet-
Blog/Puppies-and-kittens-/ [R=301,L]

RewriteRule
^BehaviourforDogs/LocalDogTrainingClubs/tabid/16829/Defau
lt\.aspx$ http://www.sydneyanimalhospitals.com.au
[R=302,L]
RewriteRule ^PetTools/Articles/tabid/16936/Default\.aspx$
http://www.sydneyanimalhospitals.com.au
RewriteRule
^PetTools/AskTheVet/tabid/16938/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]
## RewriteRule
^PetTools/PetOfTheWeek/tabid/16935/Default\.aspx\?
ArticleID\=2095$ http://www.sydneyanimalhospitals.com.au
[R=302,L]
RewriteRule
^PetTools/PetOfTheWeek/tabid/16935/Default\.aspx$
http://www.sydneyanimalhospitals.com.au? [R=302,L]
RewriteRule
^PetTools/WinOnTheWeb/tabid/16933/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]
RewriteRule ^Newsletter/tabid/16818/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]
RewriteRule ^CaseStudies/tabid/16820/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]
RewriteRule
^PetTools/VetAlerts/tabid/16939/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]
RewriteRule ^OnlineStore/tabid/16941/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]
# RewriteRule
^PetTools/PickaPet/BreedsList/tabid/17148/Default\.aspx\?
Species=Dog&kw1=41&kw2=45&kw3=49&kw4=53&a
mp;kw5=56&kw6=61&kw7=65&kw8=68&kw9=71&
;kw10=74&kw11=78&kw12=82&kw13=85&a$
http://www.sydneyanimalhospitals.com.au [R=302,L]
RewriteRule
^PetTools/PickaPet/BreedsList/tabid/17148/Default\.aspx$
http://www.sydneyanimalhospitals.com.au? [R=302,L]
RewriteRule
^Newsletter/NewsletterArchive/tabid/16819/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]
RewriteRule
^PetTools/KidzKorner/tabid/16940/Default\.aspx$
http://www.sydneyanimalhospitals.com.au [R=302,L]

## CLINIC REDIRECTS ##

RewriteCond %{HTTP_HOST}
^(?:erskinevillevet\.com\.au|www\.erskinevillevet\.com\.a
u)$ [NC]
RewriteRule (.*)
http://www.sydneyanimalhospitals.com.au/en/Our-
Hospitals/Newtown-vet-hospital/ [R=301,L]

RewriteCond %{HTTP_HOST}
^(?:matravillevet\.com\.au|www\.matravillevet\.com\.au)$
[NC]
RewriteRule (.*)
http://www.sydneyanimalhospitals.com.au/en/Our-
Hospitals/Matraville-vet-hospital/ [R=301,L]

RewriteCond %{HTTP_HOST}
^(?:kellyvillevet\.com\.au|www\.kellyvillevet\.com\.au)$
[NC]
RewriteRule (.*)
http://www.sydneyanimalhospitals.com.au/en/Our-
Hospitals/Kellyville-vet-hospital/ [R=301,L]

RewriteCond %{HTTP_HOST}
^(?:innerwestvet\.com\.au|www\.innerwestvet\.com\.au)$
[NC]
RewriteRule (.*)
http://www.sydneyanimalhospitals.com.au/en/Our-
Hospitals/Inner-west-vet-hospital/ [R=301,L]

RewriteCond %{HTTP_HOST}
^(?:norwestvet\.com\.au|www\.norwestvet\.com\.au)$ [NC]
RewriteRule (.*)
http://www.sydneyanimalhospitals.com.au/en/Our-
Hospitals/Norwest-vet-hospital/ [R=301,L]

## CLINIC REDIRECTS ##

RewriteCond %{HTTP_HOST} ^sydneyanimalhospitals\.com\.au$
[NC]
RewriteRule (.*)
http://www.sydneyanimalhospitals.com.au/$1 [R=301,L]



## catch all
## RewriteCond %{REQUEST_FILENAME} !-f
## RewriteCond %{REQUEST_FILENAME} !-d
## RewriteRule .? http://www.sydneyanimalhospitals.com.au
[NC,L]


__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 09 December 2011 at 5:00am

No wonder there's a conflict somewhere here.
Please, provide the rewrite.log for testing request.
Logging issues described in FAQ

Regards
Andrew
Back to Top
 
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 04 January 2012 at 7:13pm

How can I attach the log file here?

Cheers,
Jan

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 05 January 2012 at 3:20am

You may add an extract from the log, not the whole thing. simply make sure it starts with

Code:
... (2) init rewrite engine with requested uri /YOUR_URL_HERE



Regards
Andrew
Back to Top
 
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 05 January 2012 at 4:11pm

Hi,

I added this on top of the log file

... (2) init rewrite engine with requested uri
/www.sydneyanimalhospitals.com.au

with 3 periods in front. Is that included?

I also tried adding this:

(2) init rewrite engine with requested uri
/www.sydneyanimalhospitals.com.au

And still it produced a lot of entries (1MB file)

So is there anyway I can give you this one for testing request?

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 06 January 2012 at 5:19am

Sure, go to helpdesk to send a message and attach log. Please, refer to this topic and mark subject: "To Andrushka"

Regards
Andrew
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version