Re[2]: [PHP] Best way to do this: www.domain.com?page=var
| From: | Steve Clay | Date: | Tue, 17 Jan 2006 04:29:23 +0000 |
| Subject: | Re[2]: [PHP] Best way to do this: www.domain.com?page=var | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-228697@lists.php.net to get a copy of this message | ||
Monday, January 16, 2006, 5:14:49 PM, tg-php wrote:
> Should just be a matter of adding "start.php" to your defaults list in
> whatever priority order you want.
Apache's .htaccess:
DirectoryIndex start.php index.php index.html
In start.php:
// instead of redirecting, just set page
if (!isset($_GET['page'])) {
$_GET['page'] = 'home';
}
If, for some reason you /can't/ change the directory index page, make an
index.php with this:
// again, no redirect necessary
$_GET['page'] = 'home';
require('start.php');
Steve
--
http://mrclay.org/