Forum Moderators: open

Message Too Old, No Replies

ISAPI rewrite

i need some help

         

DaveN

4:54 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



products.asp?prod_id=22

RewriteRule
(.*?\.asp)(\?[^/]*)?/([^/]*)/([^/]*)(.+)? $1(?2$2&:\?)$3=$4?5/$5: [N,I]

outputs := products.asp/prod_id/22

what i want is a rewrite to

products/prod_id/22.htm

Help

DaveN

andreasfriedrich

4:28 pm on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Dave,

there probably are not many users around here who use an ISAPI rewriting module. I donīt use one.

I believe that moving the first parens will help:

RewriteRule
(.*?)\.asp(\?[^/]*)?/([^/]*)/([^/]*)(.+)? $1(?2$2&:\?)$3=$4?5/$5: [N,I]

Andreas

Tappy

10:53 am on Feb 12, 2003 (gmt 0)

10+ Year Member



Right I've just got this tool workin' and now I've worked out how it works.

RewriteRule
(.*?\.asp)(\?[^/]*)?/([^/]*)/([^/]*)(.+)? $1(?2$2&:\?)$3=$4?5/$5: [N,I]

Which is at the bottom of the documentation I believe, well I hate to say this but in my opinion and indeed my servers opinon too it's wrong the slash at the end should be removed this will look as follows

RewriteRule
(.*?\.asp)(\?[^/]*)?/([^/]*)/([^/]*)(.+)? $1(?2$2&:\?)$3=$4?5$5: [N,I]

what this will do is change a url from

[blah.com...]

to
[blah.com...]

if you want to change it to something else if you give some information as to what you want to change it from to, a couple of examples I'll see if I can help you out.

products/prod_id/22.htm

DaveN

11:14 am on Feb 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cheers Tappy and welcome to WebmasterWorld,

I have stickied you a site.

want i am try to achieve is

www.stickysite.co.uk/product.asp?stock_id=60

rewrite it to

www.stickysite.co.uk/product/stock_id/60.asp

DaveN

Tappy

11:48 am on Feb 12, 2003 (gmt 0)

10+ Year Member



OK the following rule should do the job for you

RewriteRule (.*)\.asp\?([^=].*)=(.*) $1/$2/$3.asp