[techtalk] mod_rewrite

Mary Gardiner linuxchix at puzzling.org
Fri Apr 20 15:50:34 EST 2001


Can anyone talk me through this use of mod_rewrite in apache?

Diary entries[1] have urls that look like
/diary/diary.php?year=01&month=04&day=20&sub=1
and I want to rewrite
/diary/01/04/20/1/
to that.

Month indices look like
/diary/month.php?year=01&month=04
and I want to rewrite
/diary/01/04/
to that.

Currently the config looks like:
RewriteEngine  on
RewriteBase    /diary/
RewriteRule ^[^/]+/[^/]+/$ month.php?year=$1&month=$2
RewriteRule ^[^/]+/[^/]+/[^/]+//[^/]+/$ coat.php?year=$1&month=$2&day=$3&sub=$4

and is located in the <Directory> section for the directory that is
DocumentRoot.

I get 403 forbidden in that directory now that the rewrite is there, and the
rewrite log tells me that it is applying the rules to /index.php

Mary.
					
[1] No this isn't my vaunted diary templating thing, this is a hack.
-- 
Mary Gardiner
<mary at puzzling.org>
GPG Key ID: 77625870




More information about the Techtalk mailing list