mod_rewrite, .htaccess and the root directory problem
I'm having a problem with using mod_rewrite on a per-directory basis when the directory is the site's root directory. I want all requests for files in the site's root directory to be rewritten (redirected) to my script.
I've put the .htaccess file in the root directory and included RewriteBase / in it (although I don't think that line is necessary).
If a requested file actually exists in the root directory, then the request is rewritten (redirected) to my script file. But when the requested file does not exist, a 403 (forbidden) message is returned.
If the whole thing is done in a sub-directory, then everything works ok, and requested files need not exist.
I've been looking at the difference between the physical and URL paths, but I don't think the answer lies there, or it wouldn't work in a sub-directory.
Anyone got any idea of how to rewrite (redirect) all file requests for files in the site's root directory to my script using mod_rewrite with the .htaccess file?
|