I want to redirect from /gallery/X to gallery.php?category=X
But when I actually goto the address, my old $_GET variable 'category' is transformed into the form:
$_GET['category'] = "X.php/X"
This is what my .htaccess looks like:
RewriteBase /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^gallery/(.*)$ /gallery.php?category=$1 [L]
I am very bad at RegEx and no almost nothing about .htaccess. I have been trying to play around with this rewrite rule to preserve the $_GET variables, but nothing I do seem to work. What am I supposed to do here?
Thanks!