This is similar to multiple endpoints to same page, but the fact that I'm trying to display the home page rather than some sub-page within the site seems to be throwing things off
I have 3 URLs:
www.mysite.com/test/link1
www.mysite.com/test/link2
www.mysite.com/test/link3
I would like for requests to all 3 to display the page at www.mysite.com. Additionally, I need for the URL displayed in the browser's location bar to remain unchanged.
Currently, I'm using:
<?php
add_action('init', 'add_my_rule');
function add_my_rule()
{
add_rewrite_rule('^test\/link.*$','index.php','top');
}
?>
Requesting any of the above URLs does display the page at www.mysite.com
as expected, BUT the URL displayed in the browser's location bar also changes to www.mysite.com
instead of remaining unchanged and keeping the URL of the initial request.
I'm guessing it has something to do with my .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
but I'm not really sure what it could be.