httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ari Davidow <...@ivritype.com>
Subject [users@httpd] stripping trailing slash
Date Tue, 06 Jan 2004 18:34:34 GMT
I am running an application (written in php, if that matters) such that 
whatever string someone types after the server name should be passed to the 
application as an argument, e.g., for

http://www.foo.com/dothis

"dothis" is passed to the application.

Unfortunately, knowledgeable people keep adding trailing slashes, which 
seems to break things. I haven't found a working way to remove the trailing 
slash (if extant) prior to passing the string to my application.

I am using mod_rewrite, and first tried:

         ReWriteRule ^/notfound.html - [L]
         ReWriteRule ^/([-a-zA-Z0-9_]*)?/+$ /myscript/$1 
[T=application/x-httpd-php]

which simply doesn't seem to catch anything (vs.

         ReWriteRule ^/([-a-zA-Z0-9_]*)?$ /myscript/$1 
[T=application/x-httpd-php]

which works for everything but strings with trailing slashes.

What obvious thing am I missing? Surely this should be trivial.

ari


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message