Support » Fixing WordPress » index.html redirecting to index.php

  • We have a number of photomaps in subfolders which are launched by index.html pages eg http://carnethy.com/maps/photomaps/eskapade15/index.html

    These used to open fine but now they just redirect straight to the home page (as you can see!), ie to index.php

    How can I stop WP doing this? Or is it possibly Bulletproof Security’s htaccess rules doing it? (they’re so complicated I can’t understand them).

    • This topic was modified 1 month, 3 weeks ago by digbymaass.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Since WordPress uses index.php and not index.html in order to load correctly you MUST have index.php load over index.html in your WordPress installation folder. BPS comes with that htaccess code in the standard BPS Root htaccess file to ensure WordPress loads correctly.

    Since your photomaps are in a subfolder instead of directly in your WordPress installation folder then the solution is very simple and easy…

    1. Download a copy of the BPS Root htaccess file (.htaccess) from your website (WordPress installation folder – same folder where wp-config.php is).

    2. Edit the downloaded BPS Root htaccess file and remove/delete all htaccess code from the htaccess file. Then add only the htaccess code shown below. Save your editing changes.

    3. Upload your new edited htaccess file to your photomaps root folder. Logically that would be this folder: /maps/photomaps/. Note: htaccess files are hierarchical/recursive, which means that htaccess rules in a parent folder will be applied to all child folders (subfolders) below the parent folder.

    RewriteEngine On
    
    # DIRECTORY INDEX FORCE INDEX.PHP
    # Use index.php as default directory index file. index.html will be ignored.
    # If a 500 Internal Server Error occurs when activating Root BulletProof Mode 
    # copy the entire DO NOT SHOW DIRECTORY LISTING and DIRECTORY INDEX sections of code 
    # and paste it into BPS Custom Code and comment out DirectoryIndex 
    # by adding a # sign in front of it.
    # Example: #DirectoryIndex index.php index.html /index.php
    # This line below has been commented out for Photomaps
    #DirectoryIndex index.php index.html /index.php
    # This line below has been created for Photomaps
    DirectoryIndex index.html
    • This reply was modified 1 month, 3 weeks ago by AITpro.
    • This reply was modified 1 month, 3 weeks ago by AITpro.

    I see the logic – I was actually reading that bit in the whole htaccess file as you replied. Trouble is it isn’t working! Still getting the redirect.

    I wonder if it’s because of this further down the main htaccess file –

    # CUSTOM CODE BOTTOM HOTLINKING/FORBID COMMENT SPAMMERS/BLOCK BOTS/BLOCK IP/REDIRECT CODE
    # WP AUTHOR ENUMERATION BOT PROBE PROTECTION
    # Rewrites to author=999999 that does not actually exist
    # which results in a standard 404 error. To the hacker bot
    # it appears that this author does not exist without giving
    # any clues that the author does actually exist.

    RewriteCond %{QUERY_STRING} ^author=([0-9]){1,}$ [NC]
    RewriteRule ^(.*)$ $1?author=999999 [L]

    # redirect index.html to new site
    RedirectMatch 301 ^(.*)/index.html$ http://carnethy.com/

    Ha! Yes it was the redirect from the old site to the new that was doing it! I’d forgotten that was there; it’s been years since we moved to WP.
    And in fact it now opens without the htaccess in the photomaps folder.
    Now all I need to do is deal with Gmaps new API requiring a billing account to show maps 🙁

    Thanks for your speedy help!

    • This reply was modified 1 month, 3 weeks ago by digbymaass.
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.