Rewrite ignoring .asp files

Topics: User Forum
Jul 16, 2008 at 1:31 PM

I'm trying to make a site search engine friendly, rather than using  /page.asp?id=nnn, use /page.asp/id=nnn

I've the following rule

RewriteRule ^/(.+)/id=(.*)$ /$1?id=$2&%{QUERY_STRING} [L]

Now, if I put the (wrong) url


that is correctly rewritten to


but if I put


It doesn't even appear in the logfile as a "no match", whilst the IIS server returns the same content as for /page.asp (with no ID string).

I can only presume it's picked up on the existence of a valid ASP script and assigns "process asp" as higher priority then "rewrite url".

I've assigned the IIRF high priority, but it's still doing this. Has anyone a brilliant idea?

Jul 16, 2008 at 4:30 PM

I understand what you are saying . This is a puzzle.

The URL requests should all come into IIRF.  If you get one,  you should get them all.

I have never before seen a case where you only get "some" requests.

Let me ask, have you tried with other extensions?  page.php?  page.jsp?  Are you able to get any "no match" queries in the log file? Is it only .asp extensions?

Have you looked at the priority of the ASP Engine in IIS manager?

Jul 16, 2008 at 11:39 PM
I'll try it with .pl  - it's an IIS server, don't have a php or jsp handler on it. (and I can't help but think I'd not have the problem if it was on apache, but the client is King).

Yes, I do get some no match entries.

I'd love to look at the priority of the ASP engine. It runs as an ISAPI extension, not as an ISAPI filter, so isn't in the same priority list and I'm not really sure how to tweak that (if it can be tweaked).
Jul 17, 2008 at 10:12 AM
/ rewrites correctly to /

/test.aspx/id=101 rewrites correctly to /test.aspx?id=101

So it does seem to be specific to the .asp extension (without going through numerous test cases).
Jul 17, 2008 at 5:14 PM

ok .... Hmmmm...

could anything else be handling the .asp extension?  Is there a proxy server in front of the web server by any chance?  Like maybe a Microsoft ISA Server?

Is there an authentication filter that might be grabbing the ASP URLs, like maybe something from SiteMinder or something similar?

Can you set up a test server (maybe in a virtual PC) to see if it is reproducable?


Jul 21, 2008 at 10:28 AM
Unfortunately it's a straightforward IIS server, with no clever tricks, so I really can't account for why .asp is ignored.

I've given up on the idea (deadlines looming and I have to move forward) and am running another version of the software which runs apache/php instead and all my problems have mysteriously gone away. To be honest, the ASP version of the software seemed to become more and more ill on a daily basis, so I'm moderately glad to be rid of it on a number of levels.

Thanks for the time you've spent looking at this.