I want to change from this address:
www.domain.com/game.php?id=1
to somthing like that:
www.domain.com/game/1/THE-NAME-OF-T
Probably the best way is to redirect page to correct url like code below:(work for me)
if (isset($_GET['id'])) {
$script_url = "http://localhost/scripts/myscripts/";
$row = dbgetrow("SELECT * FROM games WHERE id = %s",$_GET['id']);
if ($row) {
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: ".$script_url."/game/".$row['id']."/".seo_title($row['name']));
} else {
Header( "HTTP/1.1 404 Not found" );
}
}
and in .htaccess file you can also set RewriteBase
to somethings like RewriteBase /
or RewriteBase /YOUR_SCRIPT_PATH_WITHOUT_HOST_NAME/
also see Apache Doc