URL Rewrite - ASP

Posted on 2012-08-17
Last Modified: 2012-08-20
Hi Experts,

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


I'm keen for this to change to -


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 -

Question by:garethtnash
    LVL 44

    Accepted Solution

    at first glance, I don't see anything to match the p character before the equal sign.

    Author Comment

    You are of course correct, thank you,..

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


    redirects to -


    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


    Author Closing Comment

    thank you

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now