folder defaults to wrong file
Moderator: General Moderators
folder defaults to wrong file
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?
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.
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
Code: Select all
header("Location: portal.php");Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
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.
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...
?>