This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions
 Helicon Tech : Common Questions
Subject Topic: Need a Rewrite Rule (Topic Closed Topic Closed) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sharanhp
Newbie
Newbie


Joined: 28 October 2009
Location: India
Online Status: Offline
Posts: 2
Posted: 28 October 2009 at 7:56am | IP Logged  

Hi,

I am new to URL rewriting, need help in writing a rule.

I have a URL like this:

http://www.somedomain.com/GS091016812666/24/47/0/Strategi
es/Sourcing/sometitle

which should be rewritten as:

http://www.somedomain.com/Content/GS091016812666.asp?
sectionid=24&categoryid=47?PID=0

The last part: "/Strategies/Sourcing/sometitle" be
ignored.

I am using version 3.1.0.67 on IIS 6.0

Greatly appreciate if somebody can give me the rule.

Thanks.




Back to Top View sharanhp's Profile Search for other posts by sharanhp
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 28 October 2009 at 9:48am | IP Logged  

Please try to use the following config:

RewriteBase /
RewriteRule ^([^/]+)/(\d+)/(\d+)/(\d+)/.*$ Content/$1.asp?sectionid=$2&categoryid=$3?PID=$4 [NC,L]

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


Joined: 28 October 2009
Location: India
Online Status: Offline
Posts: 2
Posted: 30 October 2009 at 8:56am | IP Logged  

Thanks, this worked fine.
I am still learning, but have to demo my client with some
changes.
Now how does the rule look like if I move around certain
part of the URL:

http://www.somedomain.com/Strategies/Sourcing/sometitle/G
S091016812666/24/47/0/

"Strategies/Sourcing/sometitle/" is moved ahead, which as
earlier to be ignored.

rewritten URL remains the same:

http://www.somedomain.com/Content/GS091016812666.asp?
sectionid=24&categoryid=47&PID=0

TIA
Back to Top View sharanhp's Profile Search for other posts by sharanhp
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 30 October 2009 at 9:20am | IP Logged  

Please try to use this:

RewriteBase /
RewriteRule ^Strategies/Sourcing/sometitle/([^/]+)/(\d+)/(\d+)/(\d+)/?$ Content/$1.asp?sectionid=$2&categoryid=$3&PID=$4 [NC,L]

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

Sorry, you can NOT post a reply.
This topic is closed.

  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 cannot vote in polls in this forum