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: redirect only two urls - pretty to ugly
Author
Message |
clausg
Newbie


Joined: 01 December 2010
Posts: 7
Posted: 03 January 2012 at 1:29pm

Hi Andrew,

I checked the FAQ and was able to get one of our redirects to work but not the another, was hoping you
can help. Basically, if a user type www.xyc.com\customcars we want to take them to our less pretty url.

I just want to redirect these two urls, got the top one to works, bottom doesn't. They
both use the same mapfile.

1.

# Redirect xyx.com\unsubscribe to custom.aspx=?id=16
RewriteBase /
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteMap revmapfile txt:revmapfile.txt [NC]
RewriteCond %{QUERY_STRING} (.+)
RewriteRule ^custom.aspx=?id=16 ${mapfile:%1}? [NC,R=301,L]
RewriteCond ${revmapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([^/]+)$ custom.aspx?${revmapfile:$1} [NC,L]

2.

# Redirect xyz.com\customcars to category.aspx?categoryID=278
RewriteBase /
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteMap revmapfile txt:revmapfile.txt [NC]
RewriteCond %{QUERY_STRING} (.+)
RewriteRule ^category.aspx?categoryID=278 ${mapfile:%1}? [NC,R=301,L]
RewriteCond ${revmapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([^/]+)$ category.aspx?${revmapfile:$1} [NC,L]

Tks
Claus
Back to Top
 
Guests
Guest


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

The following two rules are matching the same patterns:
Code:
RewriteRule ^([^/]+)$ custom.aspx?${revmapfile:$1} [NC,L]

and
Code:
RewriteRule ^([^/]+)$ category.aspx?${revmapfile:$1} [NC,L]


You need to modify your URLs so that the patterns would change. E.g. /cat/customcars/ instead of /customcars/

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