I am using a GET variable to select a specific item to display on the page. My URL would usually look like:
/?type=xxxx
I then have a login plugin (WordPress) which adds ?redirect=ok
to the URL on submission. Unfortunately, this then makes the URL look like: /?type=xxxx?redirect=ok
which breaks the previous variable.
I am trying to edit that URL somehow. I thought about a few methods:
- .htaccess to find and rewrite the
?redirect=ok
to blank or to &redirect=ok - PHP to strip that part out of the string and then redirect
None of these seemed to work.
Any help would be massively appreciated.
Here is
mod_rewrite
fix for this strange problem.Put this code in your
DOCUMENT_ROOT/.htaccess
file as very first rule: