I've got some .htaccess files which perform rewrites and redirect errors to logs on my production server. I'd like to keep a copy of the .htaccess files locally, at the same time preventing the actions from firing when in my local environment. Is there a way to either ignore the .htaccess files altogether or check if I'm accessing the .htaccess files locally from within the .htaccess file?
Thanks so much,
There are two ways you can do this.
- Assuming the production domain is different than your development domain, check for the current domain in the RewriteRule
- Assuming you have access to httpd.conf on your localhost change the value of AccessFileName in there. Something like
My personal preference is the second option, since I don't like environment checks in a production environment.
Cool! I really like the second solution...
This topic is now closed. New replies are no longer allowed.