I have just one index.php file that generates the other pages using:
RewriteRule ^page 1.php$ index.php?cat=a [NC]
RewriteRule ^page 2.php$ index.php?cat=b [NC]
I'm trying to use the following code to change the title of my pages but it's working just for index.php.
<?php
$page = $_SERVER['PHP_SELF'];
if(isset($page)) {
switch($page) {
case "/index.php":
$title = "this is homepage";
break;
case "/page 1.php":
$title = "products";
break;
case "/page 2.php":
$title = "services";
break;
}
}else{
$title = "default title";
}
print "<title>$title</title>";
?>
%20.$_GET['cat'].