I succeeded in making .htaccess rewrite URLs so I can link to pages without having to define the extension. But, only one of the pages won’t work.
The page is called ‘games.php’ and I link to it through <a href="games">Go to Games!</a>
But whenever I go to it, it goes to ‘/games/’, as if it were a folder, and then gives an Error 404.
I don’t know how to fix it. I checked, there’s no folder or any other file called like this, and it works on all the other pages… (also on games?id=blabla…)
Here’s my .htaccess code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC]
Thanks in advance,
Dalionzo 😀
UPDATED
Now it works without parameters too.
website.com/game.php?id=blablabla –> website.com/game?id=blablabla