You need help with redirection + masking a domain using .htaccess. It partially works. It works for subpages and subdirectories, but not for the domain itself.
I have two domains: redir1 and redir2. The goal is to redirect using .htaccess and mask as follows:
http:
http:
http:
And the URL displayed to the visitor should remain what they entered:
http:
http:
http:
But if they are logged in http://redir1, they should see http://redir1in the url.
each domain has the following two files: index.php sub.php
Here is the code in .htaccess:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?redir2$ [NC]
RewriteRule ^ http://redir1%{REQUEST_URI} [L,NE,P]
It works very well for all requests that have something after the domain (subpages and subdirectories). For instance:
http:
http:
But if I type only http://redir2/, I get a "Not Found" error:
The requested URL /index.html was not found on this server.
, index.html, index.php
index.html?