Here’s the problem.. I have a tally with a hosting company right this moment that gives me 2 domain names. I’m using not even 10% of my own alloted bandwidth/space… so I wanted to make use of my deal while I have it. I have two domains I would like to host on one basically… (I have 3 OR MORE domains right now) I wanted to know if it turned out possible (using. htaccess) to route a hit subject to the domain someone entered.
Case:
Forms in: www. maindomain. com
Redirects to be able to: nothing, normal bottom directory. /
Forms in: www. otherdomain. com
Redirects to be able to /otherdomain/ subfolder with site.
Is that this possible Or am I merely dreaming
do that:
rewriteEngine on rewriteCond %HTTP_HOST otherdomain. com/. *$ AND ALSO, NC rewriteCond %HTTP_HOST urlwww. otherdomain. com/. */url$ AND ALSO, NC rewriteRule (. *)$ urlhttp: //maindomain. com/otherdomain//url$1
You might also direct two domains for the same page and now have the page existing content dynamically with the domain that is typed in.
Used to do that for an organization one time this had 20 domains pointing to the same website. Basically, each had a look and company logo and what not necessarily, but they all had the identical functionality.
Therefore, I tried carrying out what you stated.. and I receive the error you could see if you enter http: //www. warpspire. com generally " cant’ access /" I’m while using following code:
RewriteEngine on RewriteCond %HTTP_HOST warpspire. com/. *$ AND ALSO, NC RewriteCond %HTTP_HOST urlwww. warpspire. com/. */url$ AND ALSO, NC RewriteRule (. *)$ /nightfire/$1
I’ve placed this in notepad, renamed the idea ". htaccess" as well as put it within my root code folder.. seems enjoy it should work. Also this seems to have stopped the autoredirecting with the main domain (www. neathdesign. com) which should just visit index. html…
I’m a authentic newbie to this type of stuff.. I read a great deal about mod_rewrite but all I will seem to get is prefer a fake subdomain provider (which is really cool, I think )
Transio> that is pretty cool
The rewriteRule ought to be as I authored. Otherwise it might get into a cycle.
RewriteRule (. *)$ http: //www. neathdesign. com/nightfire/$1
This process will redirect, and will not keep the particular warpspire. com from the address bar.
Perhaps, transio’s aproach could be more appropriate.
Well I’d like to keep warpspire. com from the address bar… And that is not the situation anyway because I did try it having neathdesign. com anyway. It just states " Forbidden: are unable to access " /" with this server".
well the forbidden error has something to do with wrong permissions with your public_html or internet directory.
No it doesn’t, because as rapidly as I take out. htaccess it stays in index. html flawlessly…