One thing I'm not clear on (patch doesn't include enough detail) is if a directory url has to come in with a / in order to be considered a request for a directory. Usually a redirect should be issued if there is a directory corresponding to the url , like you don't have to put the / on the end shell directory commands. In other words, you chould do a file command to see if
there is actually a directory corresponding to the request url.

My patch comes after all the URL logic, which rewrites
http://localhost/dirname
to
http://localhost/dirname/

before my code gets run, so my patch doesn't impact that. That was very much on purpose.

I also don't know where exactly this appears in the request cycle. If you change the internal URL, you may mess up any registered filters or registered
procs which might be handling this url.

My patch happens way at the very beginning, during parsing of the actual socket data. To filters or anything downstream, it looks like the user asked for http://localhost/foo.asp rather than http:// localhost/foo and any register filters would need to take that into account. But, since most existing code would assume the .asp ending on anything they were interested in (since that's how it works now) it's unlikely that anyone would be harmed.

My suggestion is to use a filter to do this as an add on module based upon
ns_rewriteurl. It may not be as fast, but it will be vastly more
configurable.

Well, I'd probably leave to that someone else then, because fast is what I need. I'm currently running an online record label (www.magnatune.com) and get a very heavy load.

But... that's also why I posted the patch to the list. If it doesn't make it's way into the core, at least someone else may find it useful and apply the patch the their source.


Test a redirect (triggered by a 'not found' internal redirect and a directory
proc) and info on rewriteurl:

<http://rmadilo.com/files/nsrewrite/doc>

(Note that you could also use the 404 page to do exactly what you want here,
which is to look for another url if the request doesn't exist.)

A 404 would display the .adp to the end-user, which I don't want to do. Logical URLs such as http://localhost/buy are really nice, rather than http://localhost/buy.adp, which exposes a technical layer the end-user shouldn't need to see.

-john


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to