Forum Moderators: coopster

Message Too Old, No Replies

How to use php page for home page of website

php,homepage,indexpage,html,website

         

NeilsPHP

11:31 pm on Jun 27, 2008 (gmt 0)

10+ Year Member



I am trying to use mypage.php as the home page of my website (like index.html)
is there a way to do it ?

StoutFiles

12:28 am on Jun 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In your .htaccess file:

DirectoryIndex mypage.php

doxtor

6:46 am on Jun 28, 2008 (gmt 0)

10+ Year Member



or maybe you can use redirection
on your index.php, code :
<?php
header( 'Location: mypage.php' ) ;
?>

g1smd

7:52 am on Jun 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A redirect from the root of a domain to an internal page is nearly always a bad idea.

A 302 redirect is doubly bad.

If anything, use a rewrite (not a redirect).

A rewrite will not expose the internal filepath to the external viewer.

The DirectoryIndex suggestion is the easiest to implement. I would do that.

doxtor

12:31 pm on Jun 28, 2008 (gmt 0)

10+ Year Member



oo..ic..
i'm sorry if my answer is wrong :D because i don't know that, and i do that now.i'm still learning :)
btw, can you explain more clearly why it's bad?
thank you

StoutFiles

5:20 pm on Jun 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A 302 redirect is punished by search engines; your site rank will go down.

NeilsPHP

6:26 pm on Jul 1, 2008 (gmt 0)

10+ Year Member



I still am not sure how to do this.Can somebody explain step by step plz

g1smd

11:18 pm on Jul 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In your .htaccess file:

DirectoryIndex yourfile.whatever

developnew

7:04 am on Jul 2, 2008 (gmt 0)

10+ Year Member



hi dude just simple way to convert any file to index file.

1. if you using any webhosting then open your CP and select Site Management and delete the index.php (whatever) and add the file which u need to be a home page.

2. if you using IIS server then open IIS and change the root file.

thanks