I want to make a URL to look like this:
http://example.com/lobby/1
instead of
http://example.com/lobby.php?id=1
I know I can do this with .htaccess but I couldn't find a way how.
I want to make a URL to look like this:
http://example.com/lobby/1
instead of
http://example.com/lobby.php?id=1
I know I can do this with .htaccess but I couldn't find a way how.
There are several already answered questions, such as .htaccess rewrite "/book.php?id=1234" to "/book/1234"
RewriteCond %{QUERY_STRING} ^id=([0-9]+)$
RewriteRule ^ lobby\.php$ /lobby/%1? [L]
You can use the following :
RewriteEngine on
RewriteCond %{THE_REQUEST} /lobby\.php\?id=([0-9]+)
RewriteRule ^ /lobby/%1? [NC,L,R]
RewriteRule ^lobby/([0-9]+)/?$ /lobby.php?id=$1 [NC,L]
try this!
in htaccess file write this
RewriteEngine on
RewriteRule ^lobby/([0-9]+) lobby.php?id=$i
and in you html or php file call lobby.php?id=$i
page by
lobby/$i
you are done.