I am trying to do a very simple redirect for an entire web site using instructions from sites like this and this, and several others that say the same thing. I am using Apache. My .htaccess file contains this:

Redirect 301 / http://www.example.com/

It does not have any effect at all. I've also tried using RedirectPermanent, with the same result. Is there another setting somewhere else that affects this?

1 Answer 1


There is indeed another setting that controls redirects. To make Apache look at .htaccess, it is necessary to change the AllowOverrides line in the apache .conf file for the site:

<Directory /var/www/oldsite/>
      Options FollowSymLinks
      AllowOverride **None**
      Require all granted

You can replace None by All to enable all directives, or by Fileinfo if you simply want to enable the group of directives that include Redirect. You can read more about the AllowOverride control in the Apache core guide.

  • 1
    Another factor can be the depth that is configured to search Apache recursively, looking for .htaccess files that modify it's settings. If it only looks 2 levels directories deep and your .htaccess file is 3 levels deep, it won't work. Because you are causing Apache to have to look through every directory, up to the configured limit deep, it is bad for performance. Don't get me wrong, I still use them sometimes, but not if I can easily avoid it.
    – adam-asdf
    Mar 20, 2020 at 21:25

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.