You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joshua Slive <jo...@slive.ca> on 2002/06/04 15:36:25 UTC
Re: wierd URL handling / question
Scott 'INtense!' Reismanis wrote:
> 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
Remove "MultiViews" from the relevant "Options" directive.
>
> 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
>
> RewriteRule ^/(.+)([^/]+)?$ $1.php [R]
Try:
RewriteRule ^/([^/]+)/?.* $1.php [R]
Joshua.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org