| Author |
|
broodlum Newbie

Joined: 12 November 2009
Online Status: Offline Posts: 6
|
| Posted: 25 February 2010 at 11:04am | IP Logged
|
|
|
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 |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 26 February 2010 at 2:39am | IP Logged
|
|
|
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 |
|
| |
broodlum Newbie

Joined: 12 November 2009
Online Status: Offline Posts: 6
|
| Posted: 26 February 2010 at 3:19am | IP Logged
|
|
|
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 |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 26 February 2010 at 4:46am | IP Logged
|
|
|
Your code won't work, 'cause redirects in ISAPI_Rewrite require fully qualified path in the substitution string.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
broodlum Newbie

Joined: 12 November 2009
Online Status: Offline Posts: 6
|
| Posted: 26 February 2010 at 4:52am | IP Logged
|
|
|
Actually, it does work... So, umm.. that's weird?
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 26 February 2010 at 6:01am | IP Logged
|
|
|
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 |
|
| |
broodlum Newbie

Joined: 12 November 2009
Online Status: Offline Posts: 6
|
| Posted: 26 February 2010 at 6:29am | IP Logged
|
|
|
Ok, I see. Well, as long as it works I'm happy.
Thanks again for your help. Have a nice weekend!
|
| Back to Top |
|
| |