How Do I Set up my homepage?
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.
just rename your home.php
to index.php
Name the file index.php and it will work
You're options:
- Rename you're file to
index.php
- Rename you're file to
default.php
- Do a iFrame
- Do a php redirect:
header("Location: home.php");
- You could do a .htaccess redirect:
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.
you can:
- rename
home.php
toindex.php
- create
index.php
with content
<?php header('Location: home.php');?>
But, I don't recommend option #2 as it generate another useless HTTP request.
精彩评论