on the root page of a WordPress site we have a custom page template, that also handles some forms and dynamically changes part of the content.
Something like this:
<form action="" method="post">
...
<input type="hidden" name="action" id="action" value="do_this" />
</form>
and then in the page template we check for $_POST['action']=="do_this". Works perfectly.
Now we would like that when these forms are posted to have the url change (action="/do_this").
For that to work, we need /do_this to deliver the root page, but the url to not change.
we have tried this in .htaccess
RewriteRule ^do_this(.*)$ index.php?p=12 [L]
but it changes the browser url.
It must have something with WordPress, since if we use another file
RewriteRule ^do_this(.*)$ test.html [L]
it works: the url is not changed and the test.html is being delivered.
Thanks.
/do-this/
but with the content of index.php ?