This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: RewriteRule
Author
Message |
Jerry
Newbie


Joined: 28 March 2011
Posts: 2
Posted: 28 March 2011 at 2:44pm

I am totally new in using the ISAPI Rewrite utility. I have the following 2 URL's in which I need to use friendly URL's, but I can not figure out to write the RewriteRule. I have read the documentation. Please help:

URL #1:

Ugly URL:
/hgtvmicrosite/searchresults.aspx?pagetype=carpet&N=X&Product=CARPETS&Dim1=Hgtv

Friendly I want to use:
http://shawfloors-sys/HGTVcarpet

URL #2:

Ugly URL:
/HGTVMicrosite/HGTVCarpetDetails.aspx?product=CARPETS&dim1=HGTV&dim2=Butterfly_Wings_182SD-Toasted_Coconut

Friendly I want to use:
http://shawfloors-sys/HGTVcarpetDetails


Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 29 March 2011 at 3:29am

Please try to use the following rules:

[ISAPI_Rewrite]

RewriteRule /hgtvmicrosite/searchresults\.aspx\?pagetype=carpet&N=X&Product=CARPETS&Dim1=Hgtv http\://shawfloors-sys/HGTVcarpet [I,RP]
RewriteRule /HGTVcarpet /hgtvmicrosite/searchresults\.aspx\?pagetype=carpet&N=X&Product=CARPETS&Dim1=Hgtv [I,L]

RewriteRule /HGTVMicrosite/HGTVCarpetDetails.aspx?product=CARPETS&dim1=HGTV&dim2=Butterfly_Wings_182SD-Toasted_Coconut http\://shawfloors-
sys/HGTVcarpetDetails [I,RP]
RewriteRule /HGTVcarpetDetails /HGTVMicrosite/HGTVCarpetDetails.aspx?product=CARPETS&dim1=HGTV&dim2=Butterfly_Wings_182SD-Toasted_Coconut [I,L]


__________________
Regards,
Anton
Back to Top
 
Jerry
Newbie


Joined: 28 March 2011
Posts: 2
Posted: 29 March 2011 at 6:44am

Anton - Thank you so much for your quick reply, you certainly got me headed in the right direction. I need to clarify something on URL #2. The DIM2 parameter needs to be a variable (Butterfly_Wings_182SD-Toasted_Coconut) is just a sample value that could be contained in the variable. Could you please show me how this would need to be written. Again thanks for your help.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 29 March 2011 at 7:17am

Ok, I see what you mean. But in this case, we'll need to include this variable parameter name into the "pretty" URL:

RewriteRule /HGTVMicrosite/HGTVCarpetDetails.aspx?product=CARPETS&dim1=HGTV&dim2=(.+) http\://shawfloors-sys/HGTVcarpetDetails/$1 [I,RP]
RewriteRule /HGTVcarpetDetails/(.+) /HGTVMicrosite/HGTVCarpetDetails.aspx?product=CARPETS&dim1=HGTV&dim2=$1 [I,L]

__________________
Regards,
Anton
Back to Top
 

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

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum