It is easy to change the default homepage with .htaccess file. Normally the default homepage is index.htm or index.php.
what if you want to set the default homepage to some other file (say home.php) . All you have to do is create a .htaccess file in the public html folder with the following line.
DirectoryIndex home.php
It would be interesting to note that you can access the home.php with GET like this.
http://www.domain.com/?photo=254
which will be same as
http://www.domain.com/home.php?photo=254
This is a useful tip!
Tip 2
Sometimes you might want php to serve pages with different extension instead of default .php. For example you might want to setup home.do with php code in it and want php to serve this page.
Just place the following code in your htaccess and your default homepage is home.do
DirectoryIndex .do .htm .php
AddHandler x-httpd-php .do .php4 .php
Hope this helps!
Similar Posts:
- Using htaccess to redirect domain without http://
- Affiliate Hide v1.0 – Free Wordpress plugin to Hide & Redirect Affiliate Links
- PHP – How to get domain name from URL?
- Domain with WWW not resolving problem!
- Where does wordpress store htaccess rewrite rules?
- Best Wordpress Music Themes for your Music Blog
- Affiliate Hide – Free wordpress plugin to redirect affiliate links!
- CPU Exceeded Error on a New Host
- WordPress Problem – Missing Images with Plain Text Only!
- Sample DNS Zone File for BIND

