WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to make the page to load from index.html instead index.php (7 posts)

  1. alordiel
    Member
    Posted 1 year ago #

    Hello guys,
    Here is the case. I have a WP site that need something like a splash page, but to be a single page and not appearing upon the initial one. The issue is that this is multilang site and each language is on different domain (and even only the English version is using WP). So i need a starting page with the options to choose from different languages and then redirecting to the related one(and adding flags into the site is not an option).
    So far i have one index.html which should be the first to be loaded. I tried to do some redirection through the .htaccess but didn't work.
    Any ideas and suggestions are more then welcome.
    Thank you.

  2. curlybracket
    Member
    Posted 1 year ago #

    Normally, if you have a index.html file this will always load before the index.php file.

  3. alordiel
    Member
    Posted 1 year ago #

    I thought the same but it's directly loading the index.php file. So i think it might be the .htaccess but have no idea how to change it.

  4. curlybracket
    Member
    Posted 1 year ago #

    What is in your htaccess file ?

    It should look like this :

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

    Are you sure its not an error in your html file that redirects already to index.php ?

  5. alordiel
    Member
    Posted 1 year ago #

    Yes, that is exactly what my .htaccess file looks like, and here is what i have as index.html, which is quite nothing so far, so it shouldn't be a problem

    <html>
    <head>
    <style type="text/css">
    some style here
    </style>
    </head>
    	<div class="main">
    		<input id="btn" type="button" value="enter" onclick="window.location='/index.php';">
    	</div>
    </html>
  6. curlybracket
    Member
    Posted 1 year ago #

    Oh, now i understand better.

    The problem is that you won't be able to see the index.php page as long as you have the .html page there.
    I don't really know how to "fix" this.

    You should actually be able to access the index.php using this URL
    index.php?preview=true while keeping your index.html at the site root.

    But I guess the better way to go however would be to create a static front page : http://codex.wordpress.org/Creating_a_Static_Front_Page

  7. alordiel
    Member
    Posted 1 year ago #

    Thanks @curlybracket.
    I already had static front page. The idea of the index.html was just to navigate the user to whatever site he will prefer( different languages).
    But i fix my problem with the most ineffective way.
    Have just made a new folder on the server where i moved the WP instance (to be honest - i migrated it:) ) and then put the index.html in the root folder. Now the url to the actual site is a bit like: http://www.site.com/wp but as far as my knowledge goes that's all i can do : ) and it works : )
    I'll close this one as resolved.

    PS: And thank you again for the support.

Topic Closed

This topic has been closed to new replies.

About this Topic