httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott 'INtense!' Reismanis" <areis...@bigpond.net.au>
Subject wierd URL handling / question
Date Wed, 05 Jun 2002 06:22:13 GMT
Hey all,
 
My first question is regarding apache2 on my win2k box. Basically say I
enter the URL mysite.com/whatever
 
Despite there been no folder named 'whatever' a file of name
whatever.php gets loaded. Is this a feature of apache2, or have I done
something :P
 
Secondly is a sorta related question as it involves url handling.
Basically I am trying my luck at mod_rewrite. Anyhow at the moment I am
trying to get URLs to be written like this
 
mysite.com/whatever          -> mysite.com/whatever.php
mysite.com/whatever/         -> mysite.com/whatever.php
mysite.com/hello/1/2/        -> mysite.com/hello.php
mysite.com/hello/my/?what=yo -> mysite.com/hello.php
 
I imagine mod_rewrite would be ideal for this, so I made the approipate
changes to httpd.conf then tried writing various re-write rules to no
avail.
 
i.e. 
RewriteEngine On
RewriteBase /
RewriteRule ^/(.+)([^/]+)?$ $1.php [R]
 
That worked say the user entered mysite.com/whatever however the moment
a trailing slash was added (i.e. mysite.com/whatever/ or
mysite.com/whatever/4/) it would produce the error "File does not exist:
D:/Downloads/moddb/games.php/" in the log yet that file exists.
 
So is it possible to work around this problem, furthermore why is a '/'
added on the end?
 
Thanks for your time, any help would be greatly appreciated.
 
Scott 'Intense!' Reismanis

Mime
View raw message