Page 1 of 1

folder defaults to wrong file

Posted: Mon Oct 18, 2004 2:19 pm
by irealms
Atm i have just installed a portal system for a community style site. The main page is called portal.php. The domain i use for this site has a folder set as it's home directory. The problem is when going to the domain URL the browser defaults to index.php which is the forum index and not portal.php which is the main page. How can i make it default to portal if no file has been set via a link?

Posted: Mon Oct 18, 2004 2:30 pm
by pickle
I think you can do this in the apache.conf file - PHP does something similar when it's installed. A simpler way to do this though would be to make an index.php file with one line in it.

Code: Select all

header("Location: portal.php");
This isn't ideal, as index.php will still be in their history, but I think you can delete that using javascript in portal.php

Posted: Tue Oct 19, 2004 4:17 am
by irealms
yeah the only problem here is that the index i have atm is for the forums script so i can't really replace it. :(

Posted: Tue Oct 19, 2004 9:10 am
by feyd
should potentially be able to rename the forums script without too much trouble.

Posted: Tue Oct 19, 2004 9:20 am
by Gonik
You can do what feyd said. But i recommend moving the forum to a folder named eg ./forum/ and leave the portal.php where it's located. Then rename it to index.php.
In most cases you'll also need to edit it, so it points to your forums dir. try using the chdir() function in the beggining of the file.

Code: Select all

<?php
chdir('./forum/');
// rest of the code goes here...
?>