Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Simple Rewrite Of Category & Product ID’s Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
JugglerX
Newbie
Newbie


Joined: 10 August 2008
Location: Australia
Online Status: Offline
Posts: 3
Posted: 10 August 2008 at 1:58am | IP Logged Quote JugglerX

Hello again,

I'm finding understand and implementing even a simple URL rewrite extremely difficult. I've read the documentation and tried the examples to no avail.

Perhaps if I could get a working starting point I could trial and error my way from there on other areas of my website. So if anyone can suggest a rewrite rule for the following situation I would be very grateful.

I am running Isapi Rewrite 3.0 on IIS. I would like to use .htaccess files.

The main pages of my website use only 2 parameters
http://www.worldsurfaris.com/au/region.aspx?wsType=1&destID=1

wsType can be considered the category
destID can be considered the product

I would like
http://www.worldsurfaris.com/au/region.aspx?wsType=1&destID=1
=
http://www.worldsurfaris.com/surf-travel/category/product/

which in this case would result in http://www.worldsurfaris.com/surf-travel/surf-boats/Kuare-Catamaran/

Can anyone help out with a rewrite rule which would achieve this?

Rob
Back to Top View JugglerX's Profile Search for other posts by JugglerX
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4842
Posted: 11 August 2008 at 4:15am | IP Logged Quote Anton

I would advise you to use map file with the following config:

RewriteEngine on
RewriteBase /
RewriteMap mapfile txt:mapfile.txt
RewriteRule ^surf-travel/(.+)$ /region.aspx?${mapfile:$1}

And you will need to create mapfile.txt map file with the following content:

surf-boats/Kuare-Catamaran/      wsType=1&destID=1
another/smth   wsType=2&destID=2
etc.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
JugglerX
Newbie
Newbie


Joined: 10 August 2008
Location: Australia
Online Status: Offline
Posts: 3
Posted: 11 August 2008 at 7:40am | IP Logged Quote JugglerX

Hi Anton,

the region.aspx resides inside /au/ ( www.worldsurfaris.com/au/region.aspx )

I tried placing your code within a .htaccess file in /au/
I also placed the mapfile.txt in /au/

That did not work

Can you confirm this is the correct folder to place the files?
Back to Top View JugglerX's Profile Search for other posts by JugglerX
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4842
Posted: 12 August 2008 at 2:47am | IP Logged Quote Anton

Please put the .htaccess with the following content into the root of your site:

RewriteEngine on
RewriteBase /
RewriteMap mapfile txt:mapfile.txt
RewriteRule ^surf-travel/(.+)$ au/region.aspx?${mapfile:$1}

If it doesn't work, please provide rewrite log records for the specific request.


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
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 can vote in polls in this forum