• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 615
  • Last Modified:

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
0
garethtnash
Asked:
garethtnash
  • 2
1 Solution
 
aikimarkCommented:
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now