I'm trying to remove a PHP Get query from my domain. For example, instead of showing example.com/?url=1234
, I'd like it to rewrite to example.com/1234
, hiding the query but not removing it. I know this is possible and have read many tutorials on how to do this, but my code just isn't working. Here's what I'm currently trying:
RewriteEngine On
RewriteCond %{QUERY_STRING} url=
RewriteRule (.*) http://example.com/$1? [R=301]
What this is doing is stripping the query entirely, instead of just removing the ?url=
segment.