I want to keep my website/s in version control (Subversion specifically) and use svn co
to update it when there are stable versions to update, but I\'m concerne
In the same situation, I used RedirectMatch
, for two reasons. Primarily, it was the only method I could find that was allowed in .htaccess
on that server with a fairly restrictive config that I couldn't modify. Also I consider it cleanest, because it allows me to tell Apache that yes, there's a file there, but just pretend it's not when serving, so return 404 (as opposed to 403 which would expose things that website viewers shouldn't be aware of).
I now consider the following as a standard part of my .htaccess
files:
## Completely hide some files and directories. RedirectMatch 404 "(?:.*)/(?:[.#].*)$" RedirectMatch 404 "(?:.*)~$" RedirectMatch 404 "(?:.*)/(?:CVS|RCS|_darcs)(?:/.*)?$"