Usually splash pages use an “index.html” page in the website root with a link to a directory such as “blog“. But I had installed Wordpress in the root. I could not be bothered moving the installation folder from the root to another folder to suit the splash page nonsense. So I used php with an if statement to check if the user was referred to the site from outside the domain or within and thus display content accordingly:
<?php
if( (strpos($_SERVER['HTTP_REFERER'], get_bloginfo('home')) === false) && !$_SERVER['QUERY_STRING']) :
?>
<html>
<head>
<title>Splash Page</title>
</head>
<body>
<h1><a href="http://www.yourwebsite.com">Enter</a></h1>
</body>
</html>
<?php else : ?>
<html>
<head>
<title>Main Page</title>
</head>
<body>
<h1>Welcome to the main page</h1>
<h2>By the way Alan is a total ledge!</h2>
</body>
</html>
In reference to the above code; all that is before the else statement i.e. the following code:
<html>
<head>
<title>Splash Page</title>
</head>
<body>
<h1><a href="http://www.yourwebsite.com">Enter</a></h1>
</body>
</html>
Will be the output splash page. All that is after the else statement i.e. the following code:
<html>
<head>
<title>Main Page</title>
</head>
<body>
<h1>Welcome to the main page</h1>
<h2>By the way Alan is a total ledge!</h2>
</body>
</html>
Will be output when the user clicks enter on the splash page.
1:16 am - 1-7-2007
Hi, not very much understood the method. Where do I put this file? If this usefull for something like this - splash page with ad - with link to main page of the blog?
10:56 pm - 9-8-2007
This is my first post
just saying HI
2:07 pm - 12-7-2007
Creating A Splash Page For Wordpress…
Usually splash pages use an “index.html” page in the website root with a link to a directory such as “blog“. But I had installed Wordpress in the root. I could not be bothered moving the installation folder from the root to another folder to su…
6:48 pm - 1-5-2008
Well, I get it. Pretty clever. This beats the pants off using a cookie and a javascript generated overlay to simulate a splash page.
Thanks, we were taring our hairs out.
5:38 pm - 1-9-2008
This is clever, but doesn’t really work in IE.
Which leads me to ask, what kind of client would possibly want a splash page that isn’t using IE for their browser?
3:01 am - 2-10-2008
This is great in concept but it doesn’t quite work in serving only the splash page once.