should work, assuming that "tracking=1" and "tracking=2" are the literal desired values.
This code also assumes that index1.html and index2.html are NOT going to be internally rewritten back to the index.php script with those same name/values in the query. In other words, if you're trying to correct a script filepath that got exposed as a URL, then further steps will be needed to prevent an infinite redirect/rewrite loop.