So far I include everything in index.php:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]
There are also pages where I use $_GET like this:
SELECT * FROM news WHERE id = ".intval($_GET['id'])
If I want to view a news I type news?id=1
instead of ?page=news&id=1
but I want to be able to use news/1
.
Will I have to add a rewrite rule for every page where I use GET? Or is there a better way?
I hope I don't have to do this for all my pages.