I’m a mod_rewrite noob and I’m getting a headache trying to figure out something that should be simple. What I’m trying to do is strip out unwanted variables from a URL displayed after a GET form is used. In other words, I’m trying to change this:
stats.php?gender=W&team_id=88&btnGet=Get+Stats
to this:
stats.php?team_id=88
Please help me!
EDIT: All I had to do was remove the “name” attributes in my form on ‘gender’ and the submit button. Thanks to too much php and Gumbo for the solution! Of course, there was a much easier way of accomplishing this. 🙂
What would this even achieve? The URL will still appear exactly the same in the user’s address bar, and PHP is more capable of ignoring abitrary
$_GETvariables than mod_rewrite will ever be.Try removing ‘
name="btnGet"‘ attribute from your submit button and drop the ‘gender‘ field as well. You can also use Javascript to dynamically remove form elements which aren’t needed.