W head na index.php, a tamto tam gdzie mają się includować strony (1.inc.php 2.inc.php itd.)
index.php
Kod
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta name="robots" content="index" />
<meta name="description" content="Tytuł strony" />
<meta name="keywords" content="Słowa kluczowe" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Untitled</title>
<?php
header("Location: index.php?site=news");
?>
</head>
<body>
<p>
</p>
</body>
</html>
indeks.inc.php
Kod
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta name="robots" content="index" />
<meta name="description" content="Tytuł strony" />
<meta name="keywords" content="Słowa kluczowe" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Untitled</title>
</head>
<body>
<?php
if(isset($_GET[ 'site' ])){
$site = htmlspecialchars($_GET['site']) .'.inc.php';
if(file_exists($site )){
include( $site );
}else{
echo 'Strona o podanym adresie nie istnieje.'; // jeśli nie ma strony inaczej 404
}
}else{
echo 'Strona główna'; //Domyślnie nie jest index.php?as=asd ale pokazuje sie coś
}
?>
</body>
</html>
U mnie to jest tak rozwiązane

pozdro