PDA

View Full Version : Second Domain



ccwebb
03-16-2004, 07:19 AM
As usual - I leaped before I looked!

I just added a second domain to my account. These are to be two separate web pages. (They can share files and space but they are not mirrors)

Let's say the original is abc.com and the new domain is xzy.com.

I have a question.

If, for example, someone enters www.abc.com they will be directed to the index.html file.

Now for the second domain - if someone enters www.xyz.com how do they get directed to the index.html for it?

Do I have have to have a script or what?

Thanks

Charlie

WestHost - ZEsser
03-16-2004, 08:21 AM
Hello ccweb,

Create a directory on your account for xyz.com to point to. In the domain manager establish a path for that domain to point to. For instance, if you create a directory called 'xyz', in the domain manager, you need to point xyz.com to /var/www/html/xyz. Place your index.html file and your other files for this domain in this directory (or reference the files that are shared outside of the directory). The index.html file will show by default by doing this.

If you have any further questions, please let me know.

wildjokerdesign
03-16-2004, 08:31 AM
The times that I have set a second domain on an account (not that many times) I have put the index file for the second domain in sub directory. Then in Site Manager set the path for that domain to that directory. The sharing files thing can be a bit tricky. Since in my case I was using images form abc.com for xzy.com I set the base in the index file of xzy.com to abc.com. In other words:


<base href="http://abc.com/"> I placed that in the head.

That worked great for the images and I made sure that all the calles to images where from root of abc.com and not relative to the page in xzy.com. It did not work however for the SSI that was in the page. In my case the original abc.com used SSI to call the header and footer of all pages. I could not get the index of xzy.com to see the included pages that where at abc.com. I ended up duplicateing the header and footer files in the directory of xzy.com and setting my SSI call to the duplicate files. The same was true for the style sheet that was used.

If you do not make full http:// calls for the links that are in the xzy.com directory then they well be turned into links at abc.com since the base is set to that in the header.

I would imagin there was a more elegant way to do it but that is how I accomplished things.

ccwebb
03-16-2004, 08:50 AM
Zack:
Thanks! I set up the path as you said.

Wildjoker - I need to digest what you have said

Second question:

What do I have to do for email? Say I have two email accounts: abc@abc.com and xyz@xyz.com.

If I pull mail for abc@abc.com do I automatically also get mail for xyz@xyz.com?

Thanks

Charlie

wildjokerdesign
03-16-2004, 09:01 AM
Yep it is alot to think about :)

I think if your users are different you do not. I don't think you could have abc@xyz.com. This has been talked about in the email section and ways around it but they are a bit beyond me.

WestHost - MMellor
03-17-2004, 10:08 AM
Hello ccwebb,

If your main account is abc.com and you have setup an additional sub-domain xyz.com under the abc.com then all email accounts are the same no matter what extension they are sent to. For example if you have an account bob@xyz.com and somebody sends a letter to bob@abc.com it will still go to the bob account. I hope this helps and let me know if you have any other questions.

minchan
05-11-2004, 05:40 PM
Hello ccweb,

Create a directory on your account for xyz.com to point to. In the domain manager establish a path for that domain to point to. For instance, if you create a directory called 'xyz', in the domain manager, you need to point xyz.com to /var/www/html/xyz. Place your index.html file and your other files for this domain in this directory (or reference the files that are shared outside of the directory). The index.html file will show by default by doing this.

If you have any further questions, please let me know.

How do I prevent people from looking into the guts of the secondary domain through the primary domain?

eg. say I have secondarydomain.com pointing at
/var/www/html/secondarydomainfolder

so how do I stop people from reaching the same pages via

http://www.primarydomain.com/secondarydomainfolder

jalal
05-12-2004, 01:20 AM
You would need to use mod_rewrite rules I think. Either in an .htaccess file in the secondarydomainfolder, or (better) in your httpd.conf file.

Or put the secondarydomainfolder outside of the main domain tree.

HTH

minchan
05-12-2004, 08:40 AM
You would need to use mod_rewrite rules I think. Either in an .htaccess file in the secondarydomainfolder, or (better) in your httpd.conf file.
HTH

hmmm.... with the .htaccess file though, wouldn't it screw up public access for the secondarydomain.com?



Or put the secondarydomainfolder outside of the main domain tree.

HTH

Same here, wouldn't it screw up the ablity of secondarydomain.com to operate?