| Author |
|
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 24 September 2008 at 3:38am | IP Logged
|
|
|
Hi All,
Below is the my original url
http://mydomain.com/mypage.asp?x=0&y=6&z=3&hours=24&mt=2&ft=8
I need to change the url format as below
http://mydomail.com/all-areas/all-cuisines/0,6,3,24-2-8/mypage
The x, y, z are seperated by "," and hours, mt, ft are seperated by"-"
can anybody please help in writing the regular expression rewrite rule for the above?
Thanks in advance.
__________________ Shiva
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 673
|
| Posted: 24 September 2008 at 5:47pm | IP Logged
|
|
|
Hi.
Please try this:
Code:
RewriteRule ^/all-areas/all-cuisines/(\d+),(\d+),(\d+),(\d+)-(\d+)-(\d+)/([^/]+)/?$ $7.asp?x=$1&y=$2&z=$3&hours=$4&mt=$5&ft=$6 [NC,L]
|
|
|
__________________ Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 25 September 2008 at 7:21am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
Thanks a lot, and it worked fine.
I need one more help to accept a url like
http://mydomain.com/mypage.asp?x=0&y=6&z=3&hours=24&mt=2&ft=8&search=w&sort=2
I need to change the url format as below
//0,6,3,24-2-8/mypage">http://mydomail.com/<all chars>/<all chars>/0,6,3,24-2-8/mypage?search=w&sort=2
The <all chars> should accept all alpha numeric and special chars.
Please help. Once again thanks for your help.
__________________ Shiva
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 25 September 2008 at 7:41am | IP Logged
|
|
|
Please try the following:
RewriteRule ^/[^/]+/[^/]+/(\d+),(\d+),(\d+),(\d+)-(\d+)-(\d+)/([^/]+)/?$ $7.asp?x=$1&y=$2&z=$3&hours=$4&mt=$5&ft=$6 [NC,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 25 September 2008 at 8:55am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
Thanks for very quick reply.
I could not able to access the ?search=w&sort=2 after the mypage .
Please help.
Thanks
Shiva
__________________ Shiva
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 26 September 2008 at 2:37am | IP Logged
|
|
|
Please fix your rule like this:
RewriteRule ^/[^/]+/[^/]+/(\d+),(\d+),(\d+),(\d+)-(\d+)-(\d+)/([^/]+)/?$ $7.asp?x=$1&y=$2&z=$3&hours=$4&mt=$5&ft=$6 [NC,QSA,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 30 September 2008 at 6:13am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
Will try, and let you know the status.
Thanks a lot for your help.
Thanks
Shiva
__________________ Shiva
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 03 October 2008 at 2:51am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
The rewrite rule works fine.
Thanks a lot.
Shiva
__________________ Shiva
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 03 October 2008 at 9:19am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
Can you do one more help?
Out SEO guys are changing the url format from
http://mydomain.com/mypage.asp?x=0&y=6&z=3&hours=24&mt=2&ft=8&search=w&sort=2
to
//000006003024002008/mypage" _blank?>http://mydomail.com/<all chars>/<all chars>/000006003024002008/mypage?search=w&sort=2
in the bold test the first three degits(000) represents 'x', next three degits(006) represents 'y', next three degits(003) represents 'z', next three degits(024) represents 'hours', next three degits(002) represents 'mt' and the last three degits (008) represents 'ft'.
Please help me in writing the rule for the above.
Thanks in advance.
Shiva
chars>/0,6,3,24-2-8/mypage?search=w&sort=2
The <all chars> should accept all alpha numeric and special chars.
__________________ Shiva
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 06 October 2008 at 12:03am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
Can you do one more help?
Our SEO guys are changing the url format from
http://mydomain.com/mypage.asp?x=0&y=6&z=3&hours=24&mt=2&ft=8&search=w&sort=2
to
//000006003024002008/mypage" _blank?>http://mydomail.com/<all chars>/<all chars>/000006003024002008/mypage?search=w&sort=2
in the bold test the first three degits(000) represents 'x', next three degits(006) represents 'y', next three degits(003) represents 'z', next three degits(024) represents 'hours', next three degits(002) represents 'mt' and the last three degits (008) represents 'ft'.
Please help me in writing the rule for the above.
Thanks in advance.
Shiva
__________________ Shiva
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 06 October 2008 at 4:11am | IP Logged
|
|
|
Please try the following rules:
RewriteBase /
RewriteRule [^/]+/[^/]+/(\d{3})(\d{3})(\d{3})(\d{3})(\d{3})(\d{3})/mypage$ mypage.asp?x=$1&y=$2&z=$3&hours=$4&mt=$5&ft=$6 [NC,QSA,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 07 October 2008 at 8:43am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
Thanks a lot, it worked.
Shiva
__________________ Shiva
|
| Back to Top |
|
| |
cfcunha Newbie

Joined: 07 October 2008 Location: Brazil
Online Status: Offline Posts: 5
|
| Posted: 07 October 2008 at 3:57pm | IP Logged
|
|
|
I am with problem to open pag .asp using ISAPI REWRITE3 
could help me
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 08 October 2008 at 2:57am | IP Logged
|
|
|
To cfcunha: Could you please provide some more explicit explanation of your problem.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
msprasad Newbie

Joined: 24 September 2008 Location: India
Online Status: Offline Posts: 9
|
| Posted: 08 October 2008 at 5:25am | IP Logged
|
|
|
Hi Vyacheslav Shinkarenko,
The Regular expression sent by you works fine, but i have one more problem here
//000006003024002008/mypage" _blank?>http://mydomail.com/<all chars>/<all chars>/000006003024002008/mypage?search=w&sort=2
The problem is the hilighted value is 024 then the url will be
http://mydomain.com/mypage.asp?x=0&y=6&z=3&hours=24&mt=2&ft=8&search=w&sort=2
if it is 001 then the url will be
http://mydomain.com/mypage.asp?x=0&y=6&z=3&delivery=1&mt=2&ft=8&search=w&sort=2
Please help me in writing the rule for the above.
Thanks in advance.
Shiva
__________________ Shiva
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 4837
|
| Posted: 09 October 2008 at 5:04am | IP Logged
|
|
|
Sorry, but I couldn't find any obvious solution for that problem. Such specific behavior is hardly possible to be realized in ISAPI_Rewrite.
__________________ Regards,
Anton
|
| Back to Top |
|
| |