Posted By

hotdiggity on 12/07/11


Tagged

domain htaccess


Versions (?)

Host additional domain in subdirectory


 / Published in: Apache
 

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.

  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  

You need to login to post a comment.