I need to create a rewrite rule that only runs if an in page variable exists, here is some pseudo code of what I am tying to accomplish.
if ($var != null) {
// do something
}
else {
url_rewrite('current_url', 'new url');
}
The issue I am running into is that the WordPress built in function requires activation on init and would redirect regardless of whether or not the rule is present.
Any help is appreciated!