So I have developed a website with the main page named as home.php. I have also got a domain name and hosting from Godaddy. What I want to know is that how do i tell my site to display the home.php as the homepage?
I want that when the user goes to example.com -- home.php should be presented, and not example.com/home.php.
thanks.
Name the file index.php and it will work
just rename your home.php
to index.php
you can:
home.php
to index.php
index.php
with content<?php header('Location: home.php');?>
But, I don't recommend option #2 as it generate another useless HTTP request.
You're options:
index.php
default.php
header("Location: home.php");
DirectoryIndex home.php
I would choose #1 or #2!
If you choose to do an iFrame you would have to "break out" to enable the back button in the browser.
If you choose to do a redirect with php you will waste server resources.
.htaccess way: ...Don't know what's bad.