• Ok, there have been a lot of posts on similar topics, but I can’t find the answer to this specific one. I’ve taken an old site and converted it to WP1.5. The theme is derived from the default (i.e. Kubrik). The problem is this … the original site had an index.html file as the home page and there are a lot of static files that link to this (as well as other sites and bookmarks). I wanted to change the index.html file to be a simple redirect to index.php … but it doesn’t work, because WP doesn’t use the full URLs.

    e.g. https://www.ijamming.net/?p=92

    instead of https://www.ijamming.net/index.php?p=92

    So, if index.html exists, it tries to resolve to index.html?p=92

    Am I missing a setting to set it to show the full URL? Or a plug-in? Or anything else?

    Thanks
    Kenny

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

    (@macmanx)

    Create a .htaccess file in the root of your domain with the following line in it (all on one line, with a space separating index.html and http … lousy maximum forum width):

    Redirect permanent /index.html https://www.ijamming.net/index.php

    If you already have a .htaccess file in your root directory, then just add the above line to it.

    Thread Starter kmccoll

    (@kmccoll)

    Unfortunately, it behaves the same way…

    I understand that one way to “fix” this would be to alter the WP code so that it explicitly lists the URLs with the full “index.php” but I’m a bit nervous about doing that and was hoping that:

    – (best case), there was a setting I was missing, or
    – (next best case), a plug-in to take care of it, or finally
    – (not such a good case), somebody had been through the code changes before and could lead me through them

    I also realise that using the structured permalinks might help, but our current host doesn’t support the mod rewrite thing. This may be the reason why this hasn’t necessarily been seen before.

    Thanks again
    Kenny

    Ok, so the problem isn’t that you need to “redirect”, per se, but that you need to use index.php instead of index.html for any requests that don’t explicitly set the filename.

    This rule will do that:

    DirectoryIndex index.php index.html

    That says, If no file is specified in a directory, look for index.php. Failing that, look for index.html. Failing that, just list the files.

    Is that what you’re after?

    Second recommendation:
    Get a host that supports mod_rewrite. There’s simply no excuse for being bass ackwards like that these days. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP 1.5: redirecting index.html->index.php’ is closed to new replies.