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: Original URL Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sag123
Newbie
Newbie


Joined: 15 June 2007
Online Status: Offline
Posts: 8
Posted: 18 September 2008 at 8:20am | IP Logged Quote sag123

I'm working on simple website using 2 parameters

I want to rewrite
http:\\www.xyz.com\cc\home to
http:\\www.xyz.com\getcontent.asp?PageId=home&Product=cc

I've got this rule to work OK but want I want to do is, if someone was to type in the original URL convert it to the new friendly url and show it on the address bar

for example if someone typed
http:\\www.xyz.com\getcontent.asp?PageId=home&Product=cc
then the address bar should change to
http:\\www.xyz.com\cc\home
but behind the scenes redirect to
http:\\www.xyz.com\getcontent.asp?PageId=home&Product=cc

I hope that makes sense.
Back to Top View sag123's Profile Search for other posts by sag123
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 673
Posted: 18 September 2008 at 8:36am | IP Logged Quote Vyacheslav

Hi.
Please try this:
Code:
RewriteCond %{QUERY_STRING} PageId=([^/&]+) [NC]
RewriteCond %{QUERY_STRING} Product=([^/&]+) [NC]
RewriteRule ^/getcontent\.asp$ /%2/%1? [NC,L,R=301]
RewriteRule ^/([^/&]+)/([^/&]+)/?$ /getcontent.asp?PageId=$2&Product=$1 [NC,L]


__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
sag123
Newbie
Newbie


Joined: 15 June 2007
Online Status: Offline
Posts: 8
Posted: 18 September 2008 at 9:15am | IP Logged Quote sag123

That seems to wotk - thanks
Back to Top View sag123's Profile Search for other posts by sag123
 

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