How can I use in .htaccess?
<p>I want to change from this address:</p>

<pre><code>www.domain.com/game.php?id=1
</code></pre>

<p>to somthing like that:</p>

<pre><code>www.domain.com/game/1/THE-NAME-OF-THE-GAME-IN-DB
</code></pre>

<p>How can I do it?</p>

<p>And one more question:</p>

<p>I want when the user goes to address which doesnt exists, for example if it doesnt exists:</p>

<pre><code>www.domain.com/game.php?id=9123912 - this ID doesnt exists
</code></pre>

<p>The server will pass him to 404 error. How can I do it?</p>

<p>Thank you very much.</p>

<p><strong>EDIT:</strong></p>

<p>game.php:</p>

<pre><code>if (isset($_GET['id'])) {

    $row = mysql_num_rows(mysql_query("SELECT * FROM games WHERE id = '{$_GET['id']}'"));

    if ($row) {
        $game = mysql_fetch_array(mysql_query("SELECT * FROM games WHERE id = '{$_GET['id']}'"));
        Header( "HTTP/1.1 301 Moved Permanently" ); 
        Header( "Location: /game/".$game['id']."/".seo_title($game['name'])); 
    } 

    else {
        Header( "HTTP/1.1 404 Not found" ); 
    }

    exit;
}
</code></pre>

<p>htaccess:</p>

<pre><code>LIKE YOU SAID. I JUST COPIED.
</code></pre>
