1

I have a local LAMP stack (without the MySQL. LAP stack? Anyways..) and I am using this as a development environment for a production website. The site is placed in a sub-directory of the Apache2 document root and managed by Git.

My Issue is: I have a .htaccess file tracked in that subdir by Git for URL rewriting on the production server. On my local test site, these rewrite rules break almost everything (because the site is in a subdir, not the doc-root).

Is there any way to override/disable that .htaccess file without modifying anything in the subdir?

My doc root is /var/www/ with the site being hosted at /var/www/foo/.

2 Answers 2

2

Your can add into httpd.conf container for <Directory>:

AllowOverride None

and affected .htaccess will be effectively ignored.

3
  • That, interestingly enough, does not work. The .htaccess is still parsed.
    – 3321thec
    Oct 14, 2011 at 17:43
  • Strike that... Works now. Go figure. Local cache? Who know. Thanks!
    – 3321thec
    Oct 14, 2011 at 17:48
  • show config part. It must work, if was correctly defined. If it's virtial host, you'll have to modify virthost (and restart Apache, yes, after any editing conf). If you want, I can build dumb test-case on my side Oct 14, 2011 at 17:50
0

TO override parent htaccess, it worked for me to add new .htaccess to the child directory with the line: RewriteEngine off

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.