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: Basic repoint question - single url
Author
Message |
clausg
Newbie


Joined: 01 December 2010
Posts: 7
Posted: 25 October 2011 at 6:51pm

We want to use a simplified version of our site's url in our
catalog and then redirect them to the specific page on our
site.

Example:

The url in the catalog would be:
http://www.mysite.com/customcars

when a customer types the above into a browser we'd like them
to go to

http://www.mysite.com/Category/578_1/Custom_Cars.aspx




Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 26 October 2011 at 6:00am

Hello,

The solution to this issue would be described in FAQ under "Comprehensive mapfiles"

Regards
Andrew
Back to Top
 
clausg
Newbie


Joined: 01 December 2010
Posts: 7
Posted: 27 December 2011 at 4:59pm

Tks Andrew

I checked the FAQ and was able to get it to work for one type of url but not the another. Was hoping you
can help. I just want to redirect these two urls. This first redirect works, the second one 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 3:15am

Hello,

Here're the rules below that match the same thing:

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

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


This is the reason why first one works and second one stays inactive. I think we need to modify "category" URLs like /cat/customcars instead of
/customcars.

Regards
Andrew.
Back to Top
 
clausg
Newbie


Joined: 01 December 2010
Posts: 7
Posted: 05 January 2012 at 9:24pm

Are you saying our "pretty" url should be www.xyz.com/cat/customecars
instead of www.xyz.com/customcars?

That will be tough as we're already printed literature with the
www.xyx.com/customcars.

Any other ideas?

We have a rewrite built into the site that might be an issue. It takes
this www.xyz.com/category.aspx?categoryID=278 and changes it to this
www.xyz.com/Category/278_1/Custom_Math_Kits.aspx

Here is the map file:
id=16 unsubscribe
category.aspx?categoryID=278 custommathkits

Hope you can help.

Claus
Back to Top
 
Guests
Guest


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

Yes, I offered to change the SEO URL, but in case it's not an option, than yes.
What I offer now is to use different mapfiles. So in case your /customcars/ doesn't match anything in your first set of rules, it'll go to another set of rules
and will match referring entry there. Does it sound logical? Give it a try!

Regards
Andrew
Back to Top
 
clausg
Newbie


Joined: 01 December 2010
Posts: 7
Posted: 06 January 2012 at 2:33pm

Tks Andrew

Just to clarify:

I should modify my mapfile to:

id=16 unsubscribe
category.aspx?categoryID=278 custommathkits
category/278_1/Custom_Math_Kits.aspx custommathkits

do I need to change the these rules in anyway?
# 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]

A bit confused. I'm a novice.

Claus
Back to Top
 
Guests
Guest


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

No, try to create mapfile1 with
Code:
id=16 unsubscribe

and mapfile2 with
Code:
categoryID=278 custommathkits

and revmapfile1 and revapfile2.

you also need

Code:
# Redirect xyx.com\unsubscribe to custom.aspx=?id=16
RewriteBase /
RewriteMap mapfile1 txt:mapfile1.txt [NC]
RewriteMap mapfile2 txt:mapfile2.txt [NC]
RewriteMap revmapfile1 txt:revmapfile1.txt [NC]
RewriteMap revmapfile2 txt:revmapfile2.txt [NC]

RewriteCond %{QUERY_STRING} (.+)
RewriteCond ${mapfile1:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^custom.aspx= ${mapfile1:%1}? [NC,R=301,L]
RewriteCond ${revmapfile1:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([^/]+)$ custom.aspx?${revmapfile1:$1} [NC,L]

RewriteCond %{QUERY_STRING} (.+)
RewriteCond ${mapfile2:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^category.aspx ${mapfile2:%1}? [NC,R=301,L]
RewriteCond ${revmapfile2:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([^/]+)$ category.aspx?${revmapfile2:$1} [NC,L]

Back to Top
 
clausg
Newbie


Joined: 01 December 2010
Posts: 7
Posted: 17 January 2012 at 12:57pm

Thank You Andrew. That worked.
Back to Top
 

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

Printable version Printable version