Thursday, August 13, 2009

Creating a Splash Page in WordPress

Earlier this week one of my clients asked me for help on creating a splash page for a blog they where setting up. I of course said sure and figured it would only take like 2 minutes. Sadly, that wasn't the case there where a few issues that we ran into:
1) The way the blog was setup the urls looked like /?cat=16 instead of url-friendly
2) There was no way to specify a default blog page
3) The client didn't want to move the blog to a sub-folder (understandably)

The first solution I had was to set the default page but without modifying WordPress itself some of the links would just return you to the splash page. After a bit of messing around with .htaccess I finally came up with these two lines of code:


RewriteCond %{QUERY_STRING} !.
RewriteRule ^$ /splash.php


Basically what it says is if there is no querystring specified and the url is an empty string go to the splash screen. That is it and it worked!

Labels: ,

0 Comments:

Post a Comment

<< Home