Host additional domain in subdirectory


/ Published in: Apache
Save to your folder(s)

Rewrites url to appear like the additional domain appears independently hosted, however, only appropriate for a temporary web page as other pages throw an error.


Copy this code and paste it in your HTML
  1. RewriteEngine on
  2. RewriteCond %{HTTP_HOST} ^(www.)?myotherdomain.com.au$
  3. RewriteCond %{REQUEST_URI} !^/aliases/myotherdomain/
  4. RewriteCond %{REQUEST_FILENAME} !-f
  5. RewriteCond %{REQUEST_FILENAME} !-d
  6. RewriteRule ^(.*)$ /aliases/myotherdomain/$1
  7. RewriteCond %{HTTP_HOST} ^(www.)?myotherdomain.com.au$
  8. RewriteRule ^(/)?$ aliases/myotherdomain/ [L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.