In .htaccess, I have this:
RewriteRule ^land/(.*) /?land=1&exper=$1 [QSA,L]
which makes sth like this: domain.com/land/exper1
fill in the $_GET with
$_GET[‘land’] = 1 and $_GET[‘exper’] = exper1
Great.
I want to take this out of .htaccess and add the rule dynamically, that is, look for other querystring values like ‘ocean’ instead of ‘land’. I want the values to be filled into $_GET or some other var where I can evaluate them. I cant figure out if add_rewrite_rule is sposed to actually overwrite my .htaccess, but all the things i’ve tried, flush_rewrite_rules(true), etc arent doing it.
Try this and follow the same structure to add more rewrite rules or query vars:
Don’t forget to flush the rewrite rules by going to the admin area->Settings->permalinks->click save.