Jump to content


Photo

Have a splash page in addition to a home page


  • Please log in to reply
4 replies to this topic

#1 simcoweb

simcoweb

    Advanced Member

  • Members
  • PipPipPip
  • 1,094 posts
  • LocationCA

Posted 10 January 2013 - 06:20 PM

I've set up a Wordpress site and because it contains some adult oriented materials I've had to put up a splash page with a disclaimer. The Wordpress installation is in the root folder, same as the splash page.

I named the splash page as index.html. The 'home' page for Wordpress is index.php. On the splash page is a link to index.php (to enter the site) but it just keeps loading the splash page (the index.html) even though the button link is hard-coded to index.php.

Furthermore, once inside the site, if you click the 'Home' button in the menu it takes you back to the splash page even though it is also hard-coded for index.php.

I'm looking for the htaccess snippet that will identify these two pages and extensions as separate instead of confusing the index.html with the index.php which are probably, by default, both listed as default home page designations.

The .htaccess file contains the common permalinks mod_rewrite rules as follows:



# 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>


# END WordPress

To summarize, i'm in need of the instructions that would identify these two file extensions as separate and allow for the links going to index.php to parse properly.

Any help would be dyn-o-mite. Thanks in advanced, people!

#2 jonsjava

jonsjava

    Advanced Member

  • Members
  • PipPipPip
  • 1,579 posts

Posted 16 January 2013 - 05:52 PM

Add this as the first line of your .htaccess file:

DirectoryIndex index.html index.php

This will set it so that .html has priority over .php files as the default index file.
I started programming in PHP because I needed money for food. Now, I'm so busy programming I don't have time to eat!
Adding
or die ( "Query failed due to: ".mysql_error())
to your mysql queries will save you a lot of time and grief. ___ JonsJava.com

#3 nikoslefkas

nikoslefkas

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 18 October 2013 - 09:11 AM

Hello,

i add this : DirectoryIndex index.html index.php

in my .htaccess file but when i click on the link to open the index.php file it opens the index.html again... !

 

How i can resolve this problem ?



#4 Irate

Irate

    Advanced Member

  • Members
  • PipPipPip
  • 358 posts
  • LocationHamburg, Germany
  • Age:17

Posted 19 October 2013 - 06:20 AM

Rename index.php to index2.php?
Quod placet mihi non placeat tibi. - What I think to be good must not always equal your perception of it.

I am not perfect. I try a lot with the code I provide and I don't guarantee for it to work as I have mostly no option to test it on my mobile phone. I do apologize for any inconvenience I caused, but if I do happen to have helped, liking my posts or marking them as to have solved or answered your question would be nice.

#5 Adam

Adam

    Advanced Member

  • Gurus
  • 5,695 posts
  • LocationSheffield / UK

Posted 19 October 2013 - 07:52 PM

Why don't you have index.php (or every page) display the splash page instead of the normal site when the user doesn't have a cookie set? Seems a better safe guard than relying on them going through the home page, given it's a disclaimer. Also means you don't have to mess around with Apache configuration to go against the normal behaviour.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com