Recent Topics

1 May 22, 2006 19:38    

I have a site using b2e (Phoenix) where I wanted one particular post to be like a "splash page". So whenever you first come to the site, it loads up a particular post that I have chosen as a permanent intro page. Then the user can use the navigation menu to get to the various articles and whatnot.

This isn't really a hack but it is kind of a cool thing.

I wrote the article, which is really just some intro graphics (but you could include a flash animation or something), and I titled it "home" so that the permalink looks like a home page.

Then I edited my skin's _main.php file, and at the very top, right after this line:

if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

I added this code:

if( ! preg_match( '#^(.+?)index.php/([^/]+)#', $ReqPath ) ) {
  header( "Location: /index.php/home" );
  exit();
}

Now, whenever someone brings up the website, whether they go to /site.com/ or /site.com/index.php or any other combination, it uses PHP to refresh them to the b2e article /site.com/index.php/home which is my splash page. No date hacks or anything else needed.


Form is loading...