I have the following in my .htaccess file:
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ page.php?query=$1
however no matter what i type into the url, $1 is always equal to page.php
What I Expect to happen:
myurl.com/test >> myurl.com/page.php?query=test
What is happening:
myurl.com/test >> myurl.com/page.php?query=page.php
You likely have 2 redirects taking place.
page.phpitself is being redirected topage.php?query=page.php. You need to exclude it from the redirect. Better yet, exclude all real existing files and directories. Also, add[QSA'] to append any additional querystring params, as well as[L]` to stop processing any further rewrites that may come later in the file.