URL Rewrite - ASP

Hi Experts,

I have a site that uses default.asp for each page, the URL + Querystring always looks like -

/default.asp?id=1&p=a-page

I'm keen for this to change to -

/1/a-page

I've downloaded Helicon Ape which is a fantastic tool, but I just can't get my REGEX to work, here is what I have (that isn't working)

SeoRule /default\.asp\?id=(.+)(?:(?:&|&)([^&=]+)$ /$1/$2 [NC,L] 
RewriteRule ^(\d+)/.+$ /default.asp?id=$1 [NC,L]

Open in new window


Appreciate some assistance with this -

Thanks
garethtnashAsked:
Who is Participating?
 
aikimarkConnect With a Mentor Commented:
at first glance, I don't see anything to match the p character before the equal sign.
0
 
garethtnashAuthor Commented:
You are of course correct, thank you,..

However, now that it this part is working OK, this -

/default.asp?id=2&p=page-title

redirects to -

/2/page-title

but when I get to that page all links within it still contain the /2/, meaning that a link that should be written as /3/another-page-title, is actually written as /2/3/another-page-title, meaning that clicking on any link on /2/page-title just redirects to itself...

Here is my current code --

RewriteBase / 
SeoRule default.asp\?id=(.+)(?:(?:&|&))p=([^&=]+)$ $1/$2 [NC,L]
RewriteRule ^(\d+)/.+$ /default.asp?id=$1 [NC,L]

Open in new window


Thanks
0
 
garethtnashAuthor Commented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.