Welcome to WebmasterWorld Guest from 18.104.22.168
I can't seem to reach the apache docs on their site so just a quckie...
If I have a file like this:
How do I specify it in my .htaccess at root level? I have tried:
<Files /path/to/file> and <Files path/tofile> but neither work...?
I'm not sure though; the thread title suggests you want to match a directory and your post mentions a file. If it's a file, then this is the way (just a filename):
If it's a file in a specific subdir, you apparently have to make it a regexp or use FilesMatch (preferred) in stead:
<Files ~ "path/to/file.html">
No tilde "~" needed in the last one, as it uses regexps by default. Hope one of these will do the trick.
This might do it though:
Just the file name, but this will match that filename in all directories. Or:
Just the directory name, perhaps even like this (added "/" and ".*" although the last should not be necessary):
Here's an article i just found that suggests the first way to do it:
The asterisk makes sure that all files everywhere ("any sequence of characters") are matched and treated as php, that's why it works (or perhaps not, your gifs also becomes php that way). This makes me think that the problem is that the right file is not matched, so it's a regexp issue. This might do it:
included ^ to mark start of path and $ to mark the end. Enclosed it all in double quotes, these might not be needed after all.
[edited by: claus at 10:10 am (utc) on Sep. 3, 2003]
"The name of a file with no accompanying path information as in file.html."
So the regexps will send Apache looking for the path to match within the filename, and as the path is preceding the filename it is not part of it.
So, either you use that rule on all files everywhere with the same name or you use a separate htaccess file in the directory with the right file in it.