css (1) jQuery (7) linux (38) mac (70) php (29) python (1) svn/git (9) trac (4) ubuntu (1) virtualbox (6) vista (2) windows (14)

Sunday, 31 May 2009

mod_rewrite and directories

I wanted to redirect a file in a webspace of /directory/index.html to /directory/index.php so mod_rewrite for apache comes to mind!

I've never actually rewritten a directory path before so I thought it would be

RewriteRule ^/directory/index\.html$ /directory/index.php

After trying it nothing happened.... :( oddly enough you just need to chop the first / off so the rule would be

RewriteRule ^directory/index\.html$ directory/index.php