Changing Default Page Using htaccess

Filed Under Programming

I’ve been searching for the best approach in making portal.php as the default page for MyBB, a free and powerful alternative to VBulletin. I don’t want to hack into the core program as that would be a disaster when there comes new releases. That’s exactly what happened with the modifications I’ve done for SMF before. At every new releases, I have to re-code my custom changes. But that’s another story. My requirement is simple, make portal.php as the default page without modifying index.php.

Luckily, I stumbled upon a post about common hthaccess tweak and viola! What I need. On the fourth item in the list, it says :

4.Changing Default Page - Sets the file that Apache will serve if a directory is requested. This directive tell apache to make home.html to be the default page.
DirectoryIndex home.html index.htm index.html index.php

That’s exactly what I wanted and it solved my little problem! By the way, it only work on a site hosted in a Unix/Linux server.

2 Responses to “Changing Default Page Using htaccess”

Leave a Comment