Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Debian/etch3, apache2, mod_rewrite



On Thu, Jul 12, 2007 at 11:49:30PM +0900, Nguyen Vu Hung wrote:
...
> echo "<? phpinfo(); ?>" > /var/www/stagly/x115.php
> 
> cat /var/www/stagly/.htaccess
>        RewriteEngine On

RewriteBase /stagly

>        RewriteCond %{REQUEST_FILENAME} !-f
>        RewriteCond %{REQUEST_FILENAME} !-d
>        RewriteRule x125 x115.php [L]

A very useful resource when writing mod_rewrite rules is the RewriteLog,
not that it would have been of much help here but at least you can see
what the engine is doing.

Anyway, see the description here for RewriteBase:
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritebase

and this is the key of the description about per-directory rewrites:
"
#  let the server know that we were reached via /xyz and not
#  via the physical path prefix /abc/def
RewriteBase   /xyz
"

cheers
-- 
mattia
:wq!


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links