WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Index.html (45 posts)

  1. cubells
    Member
    Posted 5 years ago #

    Hi:

    I have a index.html at my wordpress directory. This page is a frontpage that redirects my visitors to my blog.

    In wp versions lower than 2.7 my index.html and the wp index.php have lived together without any problem.

    In wp 2.7 it's a problem my index.html. I have had to delete it.

    I have these options:
    wordpress address: http://www.my-site.com
    blog address: http://www.my-site.com/index.php

    When I visit my-site.com I go to my-site.com/index.html. Correct!

    But when I visit my-site.com/index.php I _always_ go to my-site.com/index.html. Incorrect!

    Any solution?

    A lot of thanks!

  2. LiZharD
    Member
    Posted 5 years ago #

    Same problem here.

  3. kmnow2004
    Member
    Posted 5 years ago #

    same problem here, help me

  4. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    You cannot have index.html and index.php in the same directory without having problems.

    What is the url of your blog?

    You have not deleted index.html - it is still functioning. You say . . .

    When I visit my-site.com I go to my-site.com/index.html.

    so when you say . . .

    In wp 2.7 it's a problem my index.html. I have had to delete it.

    that is not correct.

  5. cubells
    Member
    Posted 5 years ago #

    You cannot have index.html and index.php in the same directory without having problems.

    I have no problem ever by having index.html and index.php in the same directory. It's now with wordpress 2.7 when I have this 'issue'.

    What is the url of your blog?

    http://www.vcubells.net

    My blog adress is http://www.vcubells.net/index.php

    I have had to delete index.html page in order to browse to my blog...

    Thanks!

  6. cubells
    Member
    Posted 5 years ago #

    I have had to delete index.html page in order to browse to my blog...

    I have to delete index.html page if I want to browse to my blog.

    Now, I upload again my index.html so that you try it.

    It's a better explanation...

    thanks!

  7. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    Open the .htaccess file from your root web folder in a text editor. At the top of the file, add:
    DirectoryIndex home.php index.php
    Save and upload the modified .htaccess file. (for Apache server)

    http://codex.wordpress.org/Creating_a_Static_Front_Page

  8. cubells
    Member
    Posted 5 years ago #

    Thanks kmessinger:

    That's the first thing I had tried and it's not a solution.

    By doing that I cannot browse to my index.html page.

    What have it changed from 2.7 version to previous that I don't be able to have an index.php and an index.html page in the same root directory of my blog??

    Thanks!

  9. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    AFAIK, nothing. The decision as to which index file to bring up is done by the server. That why is is much easier not to have multiple index files in one directory. But, the order of which file opens can be controlled by the server or by your htaccess.

    Maybe something on the server changed. Have you asked the server people? Is this an Apache or Windows server?

  10. cubells
    Member
    Posted 5 years ago #

    Maybe something on the server changed. Have you asked the server people?

    Yes. Nothing has changed on the server.

    Is this an Apache or Windows server?

    Apache, of course.

    It's a problem of the wordpress: index.php redirects visitor to index.html always, when you go to http://www.vcubells.net and when you go to http://www.vcubells.net/index.php.

    If I add "DirectoryIndex home.php index.php" in .htaccess then index.html desappear.

    This issue didn't exist in wordpress version lower than 2.7.

    Thanks!

  11. LiZharD
    Member
    Posted 5 years ago #

    kmessinger if you don't know the solution please don't post.
    It's not a server related problem, it's a WordPress 2.7 redirect issue.

    Thanks

  12. cubells
    Member
    Posted 5 years ago #

    More people have the same problem :-(

    http://wordpress.org/support/topic/224398

  13. mnr
    Member
    Posted 5 years ago #

    Had the same problem.
    I had a redirect in my .htaccess from index.html to index.php
    I just had to remove it, that's all.

  14. cubells
    Member
    Posted 5 years ago #

    Hi mnr:

    I don't have any redirect in my .htaccess.

    Even if I delete my .htaccess on the server, when I browse to http://www.vcubells.net/index.php, then wordpress redirects me to index.html.

    Try it: http://www.vcubells.net/index.php
    Now I don't have any .htaccess and wordpress redirects me.

    I think your problem not is my problem.

    Paste your .htaccess if you think still that it is the same.

    Thanks!

  15. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    LiZharD

    kmessinger if you don't know the solution please don't post.
    It's not a server related problem, it's a WordPress 2.7 redirect issue.

    Thanks

    I appreciate your comment and will cheerfully ignore it.

    Regards.

  16. Rolle
    Member
    Posted 5 years ago #

    Sorry, didn't find this post in time, but I have the same problem also posted here: http://wordpress.org/support/topic/224398

    I heard there is no solution yet. Keep me posted.

    Rolle.

  17. Samuel B
    moderator
    Posted 5 years ago #

    kmessinger
    has the solution that everyone cheerfully ignores

  18. whooami
    Member
    Posted 5 years ago #

    indeed. and no surprise.

  19. mrmist
    Forum Janitor
    Posted 5 years ago #

    For what it's worth, this behaviour has changed between 2.6.5 and 2.7.

    With 2.6.5, you could have an index.html as the default page (/) for the directory, and WordPress would only load if you actually went to /index.php.

    The same is not the case in 2.7, and, as LiZharD is saying, you can no longer have that arrangement. (2.7 will always redirect /index.php to / which means you never see the blog)

    I am not sure if this is avoidable to be honest. It's an odd setup.

  20. mrmist
    Forum Janitor
    Posted 5 years ago #

    Thinking about it a bit more, you could potentially resolve it with some custom .htaccess rules that redirect visitors to / that are not being referred from local pages to /yourstartpage.html (renaming your index.html as yourstartpage.html) but that would also force any direct visitors through yourstartpage

  21. cubells
    Member
    Posted 5 years ago #

    mrmist: 2.7 will always redirect /index.php to / which means you never see the blog

    which piece of code redirects /index.php to /?

    I'll change it, because I'm not interested in this issue...

    Thanks!

  22. mrmist
    Forum Janitor
    Posted 5 years ago #

    That I'm afraid I don't know. You could try asking on the wp-hackers mailing list.

  23. ChrisThomson
    Member
    Posted 5 years ago #

    See changeset #9203. Replace the green code as seen in #9203 with the red code, in your /wp-includes/canonical.php file.

  24. cubells
    Member
    Posted 5 years ago #

    It works!!

    A lot of thanks, ChirsThomson...

  25. Rolle
    Member
    Posted 5 years ago #

    Many thanks ChrisThomson.

  26. bizethics
    Member
    Posted 5 years ago #

    Chris, are you sure it's replace the green with the red? Or is it replace the red with the green? I ask because the key says that the red is what's removed and the green is what's added.

    My text matches the green, but I am still experiencing the problem that mrmist explained above. (2.7 will always redirect /index.php to / )

    This behavior only started with the change to 2.7.

    Jeff

  27. ChrisThomson
    Member
    Posted 5 years ago #

    Yep -- the green is the new code that was introduced into 2.7, which breaks the functionality you're all used to. The red is the older code that allowed index.html files to work as you expect them to.

  28. bizethics
    Member
    Posted 5 years ago #

    Sorry, I couldn't quite get it into my head that you were telling us to revert. Everything works fine now. Thanks.

    Jeff

  29. frisco
    Member
    Posted 5 years ago #

    Chris, many thanks for your link to the changeset. I had a similar but slightly different problem, and undoing the 2.7 change restored the functionality I was used to.

    In my case, I have an index.php that is roughly like this:

    <?php
    $myhomepage=get_bloginfo('url') . '/'
    ?>
    <?php
    $mytarget="http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]
    ?>
    
    <?php if($myhomepage==$mytarget) : ?>
    ...display some selected posts as a home page
    <?php else : ?>
    ...display some different posts like a blog loop
    <?php endif; ?>

    That allowed me to have a home page of http://www.qbgarage.com and a blog loop of http://www.qbgarage.com/index.php

    #9203 broke that. Undoing it fixed it! Thanks.

  30. 3stripe
    Member
    Posted 5 years ago #

    Cheers Chris. Your edit to restore the red code in changeset #9203 fixed it for me too.

    Never had this problem with WordPress before so glad of the fix :)

    Anyone wondering why I want to have index.php and index.html sitting together - I have an html holding page up, but still want to have WordPress sitting in the same directory whilst I populate it with content.

Topic Closed

This topic has been closed to new replies.

About this Topic