Redirecting index.php to index.php?id=1

Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
As above really - I have a CMS pulling page data from a database using the page id in the url. The homepage is page '1' but obviously this variable is missing from the url when the user visits the domain, as it only shows index.php.

How would I automatically attach the variable to the url?

If there's a better way to do this, let me know.

Cheers,
 
That sounds daft.. why don't you just change it to default to page 1 within the code?

Code:
if (!isset($_GET['id'])) {
  $id = 1;
} else {
  $id = $_GET['id'];
}
 
Back
Top Bottom