I have a site with just a handful of pages, and I am trying to do a 301 redirect of everything. Everything works except the index file. It doesn't matter if I write it out as http://example.com/index.html or http://example.com/ or http://example.com, the index file won't show a redirect.

Here is my .htaccess file:

Redirect 301 / https://example2.com/
Redirect 301 /index.html https://example2.com/
Redirect 301 /services.html https://example2.com/services/
Redirect 301 /contact-us.html https://example2.com/contact/

It might help that when someone puts https://example.com/, it gets changed to https://example.com without the "/". I'm not sure if that is relevant.



In order for Redirect to be effective within an .htaccess file, you must allow the FileInfo override in your virtual host definition in your httpd.conf configuration file:

<VirtualHost *:80>

  ServerName   www.example.com
  ServerAlias  example.com

  ... blah blah

  <Directory "/">
    AllowOverride FileInfo

  ... blah blah


Add the AllowOverride FileInfo line to your configuration, restart the Apache server, and try again.

  • That line is in there. If it weren't, the other redirects wouldn't work. – Timm Simpkins May 24 at 19:59
  • Can you edit your post to include your full VirtualHost def? If you can provide more than just a narrow keyhole view of your config, perhaps someone can spot the problem. – Jim L. May 24 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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