• Hello, I am moving and old html website over to wordpress but have a issue. Everything works great loading, but when I go to http://mysite.com/index.html (my old index page) it goes to a 404 page. Since there are some external links to index.html I am getting a few 404s. This might be due to me using a splash/template page with ‘page-home.php” as a homepage template, I’m not sure. All I know is 301 redirect in .htaccess (which works for the rest of the site) is not working for the index.html. And of course if I put the index.html back on the server with a meta redirect, it just keeps reloading over and over again and gets nowhere. There’s a loop here, but I can’t seem to find a way to get around it. 301 redirect in .htaccess results in page not being displayed at all (that the redirect isn’t working). Any ideas? Has anyone come across this issue before??

Viewing 6 replies - 1 through 6 (of 6 total)
  • At the top of .htaccess, try:

    DirectoryIndex index.php

    That should force any request to go to index.php first and ignore index.html. That’s not a 301 redirect; it’s a command to force index.hp as the default document.

    Thread Starter qpsychics

    (@qpsychics)

    Thank you. I just tried it, put it right at the top, but no effect. Still going straight to 404.

    Thread Starter qpsychics

    (@qpsychics)

    Scratch that, it works! Thanks!

    Thread Starter qpsychics

    (@qpsychics)

    It works on one wordpress installation, but I’m working with two. It works perfectly at http://mywebsite.com, but I can’t get it to work at http://mywebsite.com/subfolder/ which is a separate WP installation. Is there a a modification I need to make since it’s in a sub-folder?

    What doesn’t work in the /subfolder? A 404?

    A blank .htaccess file will negate any directives in an .htaccess file in a higher level folder. But duplicating the directives in /subfolder should work.

    Try

    DirectoryIndex index.php
    Options +Indexes

    in the /subfolder

    Thread Starter qpsychics

    (@qpsychics)

    It allows /subfolder/index.php to be loaded instead of /subfolder/index.html, but when going directly to /subfolder/index.html it loads the old index.html file instead of redirecting to index.php.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘index.html to index.php redirect’ is closed to new replies.