I’d like to use .htaccess to rewrite a URL like this
https://example.com/pages/games/demons-souls/?page=mods
to look like this
https://example.com/games/demons-souls/mods
I managed to hide the pages folder in the URL with this code:
Options +MultiViews
RewriteEngine On
# Rewrite "/games/<anything>" to "/pages/games/<anything>"
RewriteCond %{REQUEST_URI} !^/pages/games
RewriteRule ^games($|/.*) pages/$0
But I need a proper RewriteRule for the Query String. I tried this but it didn’t work ...
RewriteRule ^([^/]*)/([^/]*)$ $1/index.php?page=$2 [L,QSA]
I’d really appreciate some help.