Forum Moderators: phranque

Message Too Old, No Replies

Subdomain and proper forwarding?

         

meridianblade

3:45 am on Dec 6, 2006 (gmt 0)

10+ Year Member



Hi everyone :-)

Alright I need some help setting this up properly.

I just opened a new network site at network.net, my main website example.com is going to be under that at my.network.net

In my WHM I have accounts for example.com and network.net and I know if I
make the subdomain in cpanel in the network.net account and move everything in
example to my.network.net it will work fine, but I want to keep the
accounts separate. In other words I want example.com to point to
my.network.net just like it was a sub domain in the same network.net account under
the directory /my/ but I don't want to move from the example.com
account. Then if you goto example.com it will redirect to my.network.net

Just to make sure were both on the same page:

Two accounts,
example.com
network.net

my.network.net would normally point to network.net/my as a subdomain
I want the two accounts to remain separate.
So my.network.net would really be pointing to and masking the
72.52.148.88/~example/ account instead of network.net/my and act like the
subdomain.
Then I could just do a normal forwards for example.com and point it
to my.network.net and it would work perfect.

Sorry im being confusing :-P

How would I do this? im open to anything really and btw this is on a VPS with full root access.

Thanks!

Quadrille

10:11 am on Dec 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, not with this at all.

What are you trying to achieve?

Wouldn't it be better achieved by setting up www.domain1.com and www.domain2.com - and not using subdomains at all?

jdMorgan

2:02 pm on Dec 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Part of the problem here is mixed-scope terminology. Outside the server, we have domains, subdomains, and URLs. Inside the server, we have hosting accounts, directories, subdirectories, and files. Cpanel confuses this by hiding the details and adding new terminology, such as "add-on domain", which I suspect is why this question is confusing.

Generally, Cpanel generates code that goes into httpd.conf or conf.d that designates a directory such as "user/var/www/http/" as the top Web-accessible directory. Subdirectories and files for the "main" domain are placed in this directory.

If an "add-on" domain such as "my.example.com" is added to the account, then this is placed in (for example) the subdirectory, "user/var/www/http/my/".

So, if I understand the question, the simple solution is to put a symbolic link into /my/ that points back to the top-level Web-accessible directory at user/var/www/http/ and then place a 301-Moved permanently redirect into user/var/www/http/.htaccess to redirect all requests for the old domain to the addon domain. (You may also be able to add this redirect using Cpanel.)

If adding a symbolic link is not familiar to you, you might want to ask your host to do it for you.

Jim