kreut — 2013-08-17T05:22:49-04:00 — #1
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,
scallioxtx — 2013-08-17T06:37:53-04:00 — #2
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.
kreut — 2013-08-17T09:26:16-04:00 — #3
Cool! I really like the second solution...