Here is my question:
I am wanting to redirect users from one subdomain while serving files from the previous. For example, I want a user to access their account:
- Files are located at:
holonet.example.com/account/ - I want the user’s url to point to (display):
account.example.com/
Another example:
- Files are:
holonet.example.com/account/user/reset - URL point (display):
account.example.com/user/reset
I have been trying a couple of .htaccess ways but they have not been working. Here is my latest attempts: (.htaccess in publc_html):
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(holonet\.)?thearmyoflight\.com$ [NC]
RewriteRule ^(.*)$ /account/$1 [L]
I then tried the following since the previous did not work –
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/holonet/account/
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.thearmyoflight\.com$ [NC]
RewriteRule ^(.*)$ /holonet/account/%1/$1 [L]
I think you want something like this:
This is assuming both domains point to the same document root. If not, you’ll have to rely on mod_proxy: