Topic: rewrite rule - need help!
|

|
| Author |
|
jonnyross99 Newbie

Joined: 11 May 2007
Online Status: Offline Posts: 27
|
| Posted: 10 May 2008 at 2:26am | IP Logged
|
|
|
hi
i have been going round in circles and just wondered if anyone can help me write a couple of rules for the following...
number 1
http://www.mysite.com/f1/variable1-variable2.asp
resolve to
http://www.mysite.com/f1/page.asp?name=variable1&page=variable2
number 2
http://www.mysite.com/f1/variable1-variable2-variable3.asp
resolve to
http://www.mysite.com/f1/page.asp?name=variable1&id=variable2&page=variable3
Also will i be able to use both at the same time?
many thanks in advance!
jonny
|
| Back to Top |
|
| |
Yaroslav Moderator Group

Joined: 15 August 2002
Online Status: Offline Posts: 6449
|
| Posted: 12 May 2008 at 8:43am | IP Logged
|
|
|
RewriteRule /f1/([^-]+)-([^-]+)-([^-]+)\.asp /f1/page.asp?name=$1&id=$2&page=$3
RewriteRule /f1/([^-]+)-([^-]+)\.asp /f1/page.asp?name=$1&page=$2
__________________ Yaroslav Govorunov,
Helicon Tech
|
| Back to Top |
|
| |
jonnyross99 Newbie

Joined: 11 May 2007
Online Status: Offline Posts: 27
|
| Posted: 20 May 2008 at 5:43am | IP Logged
|
|
|
hi
this is great thanks! is there any chance you could give me one for the following:-
http://www.sunglassesuk.com/f1/variable1/variable2-variable3-variable4.asp
to resolve to
http://www.mysite.com/f1/page.asp?forumname=variable1&postname=variable2&posted=variable3&page=variable4
thanks!
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 7389
|
| Posted: 23 May 2008 at 9:09am | IP Logged
|
|
|
RewriteRule /f1/([^/?]+)/([^-/?]+)-([^-/?]+)-([^/?]+)\.asp /f1/page.asp\?forumname=$1&postname=$2&posted=$3&page=$4 [I,L]
|
| Back to Top |
|
| |
jonnyross99 Newbie

Joined: 11 May 2007
Online Status: Offline Posts: 27
|
| Posted: 22 July 2008 at 10:23am | IP Logged
|
|
|
hi,
i have had to make some changes.... are you able to help me with these?
1>
http://www.mysite.com/f1/variable1-variable2-variable3.asp
which would resolve to:
http://www.mysite.com/f1/forum.asp?forumGroup=variable1&forumname=variable2&page=variable3
2>
http://www.mysite.com/f1/variable1/variable2/variable2-variable3-variable4.asp
to resolve to
http://www.mysite.com/f1/forum_viewpost.asp?forumGroup=variable1&forumname=variable2&postname=variable3&postid=variable4&page=variable
many thanks in advance. JOnny
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 7389
|
| Posted: 28 July 2008 at 4:43pm | IP Logged
|
|
|
#1
RewriteRule /f1/([^-/?]+)-([^-/?]+)-([^/?]+)\.asp /f1/forum.asp\?forumGroup=$1&forumname=$2&page=$3 [I,L]
#2
RewriteRule /f1/([^/?]+)/([^/?]+)/([^-/?]+)-([^-/?]+)-([^/?]+)\.asp /f1/forum_viewpost.asp\?forumGroup=$1&forumname=$2&postname=$3&postid=$4&page=$5 [I,L]
|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
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
|