Posted on Sunday 15th February 2009 at 06:18 PM
On my site, i want to make the URLs cleaner and nicer to use.
Atm i have: https://mysite.com/index.php?page=play&id=217
And what i want: https://mysite.com/games/play/217
In the future, i will be adding videos and pictures too, so i will have: games.php, videos.php and pictures.php
But atm, i only have index.php.
I would like to know how to do this, as i have tried, but it doesn't work.
Heres my code:
And it doesn't work.
Thanks, Dalez.
Atm i have: https://mysite.com/index.php?page=play&id=217
And what i want: https://mysite.com/games/play/217
In the future, i will be adding videos and pictures too, so i will have: games.php, videos.php and pictures.php
But atm, i only have index.php.
I would like to know how to do this, as i have tried, but it doesn't work.
Heres my code:
Code
RewriteEngine on
RewriteRule ^/(.*)/([0-9]*)$ ?page=$1&id=$2 [L]
RewriteRule ^/(.*)$ index.php?page=$1 [L]
RewriteRule ^/(.*)/([0-9]*)$ ?page=$1&id=$2 [L]
RewriteRule ^/(.*)$ index.php?page=$1 [L]
And it doesn't work.
Thanks, Dalez.