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
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Help with a simple rule Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
broodlum
Newbie
Newbie


Joined: 12 November 2009
Online Status: Offline
Posts: 6
Posted: 25 February 2010 at 11:04am | IP Logged Quote broodlum

Hi!

I'm a n00b and would like to make a basic rule as follows:

A permanent redirect (301) which replaces the word "varjatyt" with "varilliset" however it occurs in a URL, ie I want it to work for all URL's containing the word "varjatyt".

so

domain.com/varjatyt
domain.com/varjatyt_blabla
domain.com/123varjatyt

becomes

domain.com/varilliset
domain.com/varilliset_blabla
domain.com/123varilliset

etc.. you digg?

Any help is appreciated!
Back to Top View broodlum's Profile Search for other posts by broodlum
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 26 February 2010 at 2:39am | IP Logged Quote Anton

Ok. here's the syntax for ISAPI_Rewrite v2:

[ISAPI_Rewrite]
RewriteRule (.*)varjatyt(.*) http\://domain.com$1varilliset$2 [I,RP]

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


Joined: 12 November 2009
Online Status: Offline
Posts: 6
Posted: 26 February 2010 at 3:19am | IP Logged Quote broodlum

Thank you very much Anton!

Does the following work the same or could it have any drawbacks?:

Code:
RewriteRule (.*)varjatyt(.*)   $1varilliset$2   [I,RP]

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 26 February 2010 at 4:46am | IP Logged Quote Anton

Your code won't work, 'cause redirects in ISAPI_Rewrite require fully qualified path in the substitution string.

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


Joined: 12 November 2009
Online Status: Offline
Posts: 6
Posted: 26 February 2010 at 4:52am | IP Logged Quote broodlum

Actually, it does work... So, umm.. that's weird?
Back to Top View broodlum's Profile Search for other posts by broodlum
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 26 February 2010 at 6:01am | IP Logged Quote Anton

Well, that's not weird. The redirect within the same site will work with your syntax, but that's not according to the standard.

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


Joined: 12 November 2009
Online Status: Offline
Posts: 6
Posted: 26 February 2010 at 6:29am | IP Logged Quote broodlum

Ok, I see. Well, as long as it works I'm happy.

Thanks again for your help. Have a nice weekend!
Back to Top View broodlum's Profile Search for other posts by broodlum
 

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