• The contents of my .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress

    I want to redirect index.html to index.php. Can anyone advise me on how to modify my .htaccess to do this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    If you simply delete the index.html file, all browsers will go to the next index file in alphabetical sequence. In this case, it should be index.php.

    If for some reason that doesn’t work, add this to the top of your .htaccess file:

    DirectoryIndex index.php index.html index.htm

    Thread Starter mrspabs

    (@mrspabs)

    Thanks, I added it, but it did not work. I got file not found

    I should clarify, if I got to my site, it loads index.php. I do not need to put in the filename.

    However, the old pre-wordpress site was index.html. Old bookmarks and links go to index.html and they get file not found. That is why I want to redirect index.html to index.php

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    However, the old pre-wordpress site was index.html. Old bookmarks and links go to index.html and they get file not found. That is why I want to redirect index.html to index.php

    Ok, that makes sense. In that case, add this to your .htaccess file:

    Redirect permanent /index.html http://www.yourdomain.com/

    Thread Starter mrspabs

    (@mrspabs)

    I got the error

    This webpage has a redirect loop.

    The webpage at http://www.&#8212;.com/ has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

    I do not think you can do that as index.html is html file and index.php is php file and wordpress needs index.php file as script file.

    You can install wordpress on its own folder if you want and use a custom link to your html website in menu.

    shanafourde

    (@shanafourde)

    I assume you figured it out by now, but this is what worked for me.

    RewriteCond %{THE_REQUEST} ^.*/index.html
    RewriteRule ^(.*)index.html$ http://www.yourwebsite.com/$1 [R=301,L]

    I put it at the top of my .htaccess file

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘.htaccess help (redirect index.html)’ is closed to new replies.