How to prevent addon domain directing to subdomain?


EXPERIENCING PROBLEMS WITH OUR SERVICES? RUN A DIAGNOSE FIRST TO SAVE YOURS AND OUR TIME

Added: 03.07.2008 15:44:16     Last updated: 03.07.2008 15:44:16

Lets say you have the subdomain sub.yourdomain.net. On the subdomain you have the addon domain addon.net. If you have a folder named forum in the folder of the subdomain you will be directed to the subdomain if the following URL is used:
http://addon.net/forum to http://sub.yourdomain.net/forum/

You will not be redirected if you remember / at the end of the URL.

To prevent the forwarding if you do not add the / at the end of the URL you will need to add the following to a .htaccess file in the folder for the subdomain (not in the folder forum):
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^sub.dittdomene.no
RewriteRule (.*) http://tillegg.no/$1 [R=permanent,L]

sub.yourdomain.net and addon.net needs to be replaced with your subdomain and addon domain.