Here what I've already done.
RewriteRule ^([a-z]+)$ index.php?file=$1
So when visiting domain.com/browse
it actually reads domain.com/index.php?file=browse
But the problem is, this does not pass visible GET variables like this: domain.com/browse?page=2
. How do I make it pass both GET variables: domain.com/index.php?file=browse&page=2
.
Any help would be appreciated!
You can use this:
RewriteRule ^browse/?$ index.php?file=browse&page=1 [L,NC,QSA]
RewriteRule ^browse/([0-9]+)/?$ index.php?file=browse&page=$1 [L,NC,QSA]
#else it's for files
RewriteRule ^([a-z]+)/?$ index.php?file=$1 [L,NC,QSA]
or use:
RewriteRule ^([a-z]+)$ php.php?file=$1 [L,NC,QSA]
the QSA (Query String Append) flag will allow passing _GET vars
You must add the query string explicitly in your rewrite:
RewriteRule ^([a-z]+)$ index.php?file=$1&%{QUERY_STRING}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With