meany Posted December 28, 2008 Share Posted December 28, 2008 i need some help with mod_rewrite. check this out: # CREATE REWRITE OPTIONS Options +FollowSymLinks # TURN THE REWRITE ENGINE ON RewriteEngine on # WRITE PARAMETERS TO THE INDEX URL UNLESS REQUESTED URL IS A DIRECTORY OR FILE. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule page/(.*) index.php?$1 RewriteRule ^add/([^/\.]+)/?$ index.php?add=$1 [L] RewriteRule ^edit/([^/\.]+)/?$ index.php?edit=$1 [L] edit/edit_character.php $sql162 = mysql_query("SELECT * FROM players WHERE id = '{$_GET['id']}'"); right now the url is: http://site.com/edit/character&id=1 the original is http://site.com/?edit=character&id=1 what i want is http://site.com/edit/character/1 The requested URL /edit/character/2 was not found on this server. The requested URL /edit/character/id/2 was not found on this server. thanks Quote Link to comment https://forums.phpfreaks.com/topic/138619-mod_rewrite-and-_get/ Share on other sites More sharing options...
bubbasheeko Posted January 4, 2009 Share Posted January 4, 2009 Try this, substitute 'index' and 'index.php' for the file that is calling the id Options +FollowSymLinks RewriteEngine on RewriteRule index/edit/(.*)/id/(.*)/ index.php?edit=$1&id=$2 RewriteRule index/edit/(.*)/id/(.*) index.php?edit=$1&id=$2 Quote Link to comment https://forums.phpfreaks.com/topic/138619-mod_rewrite-and-_get/#findComment-729222 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.