9 Replies - 1836 Views - Last Post: 09 September 2008 - 12:39 PM

#1 ccrasherdeb  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 82
  • Joined: 03-March 08

Using 2 Domains on 1 Account

Posted 02 September 2008 - 02:56 PM

Hi,
I started web design about a year ago with (X)HTML and a text editor (Homesite+, best I've found). After the basics, I started using CS3 Master collection, Adobe Flex Pro, Visual Studio Pro and M$ Expression Web Pro. I have about 30 years in computer related experience and about 1 year in web related applications.

I bought 2 .com domains and 1 web hosting account at this point. Forgive my ignorance when it comes to the web hosting portion of web sites. My experience has been mainly with using a great free account with Awardspace.com using a sub domain or multiple sub domains. This has worked out well for learning how to place many pages on the web without much of a learning curve.

My problem is that I'd like to use my 2 domains with 1 hosting account. At present both domains open to the same homepage (index.html etc.). I would like each of the .com domains to point or open onto their own homepage. The server account I bought/rented is with Startlogic, which appears to be a great service IF you are very experienced with web sites BUT the customer assistance and service is non existent for the most part because when I called them, they didnt have a clue as to what I was trying to do or how to do it. They are great at maintaining the servers and they actually answer phone calls any time that I have called them.
***Is it possible to somehow have what would amount to 2 index.html type files to setup each of the 2 domain names with independent web sites or will I need to purchase separate hosting accounts for each domain name. How exactly would I set this up. I've researched this for several weeks with very little useful information. I feel like a complete idiot because I've created some nice applications with the software I'm using and probably have all if not overkill on the tools I need on the designing end and also have several FTP applications, but when it comes to the actual setup and working on the server, I'm lost.

Also do you think it would be wise to pay for the SSL security (I think that's what its called) on the server to secure the web sites. This gives the little box on the page that says its secure. I've worked with security quite a bit when I setup a huge wireless network at home but I don't know much about the server/hosting side of things. I have SQL server 2005 but have not even tried to use it yet until I finish with all the web design apps.

I have also thought about a web account with Network Associates, a Windows server type account which costs a little bit more but I believe might be worth it with NA. I would need to move 1 or both of my domains to the new account if I use them for hosting and as the registrar.

Any assistance would be much appreciated.
Thanks,
Debbie


The names above of my web hosts and the software I'm using are by no means the best in any way and are only my opinion on what I have available, use, and have worked the best so far for me.

Is This A Good Question/Topic? 0
  • +

Replies To: Using 2 Domains on 1 Account

#2 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Using 2 Domains on 1 Account

Posted 02 September 2008 - 03:47 PM

You should contact your web host. The answer is YES, you can use multiple domains on one web hosting account. The problem is that this is only true on some web hosts. Look for "addon domains" as that is what the function is usually called. Most web hosts running any decent control panel will offer it, though some limit how many domains you can have on one account based on your account with them.

A second, not so great, option is to use whats called a 'cloaked' domain, through your domain registrar. If they offer the service, it is like an invisible redirect. Its limited for pretty much anything except a single parking page though, so I don't recommend it.

For SSL, any sensitive login or billing forms is a good use for it. SSL by itself doesn't make your site secure, it just helps with one avenue of attack. If you do anything at all with billing information though, people will expect it.
Was This Post Helpful? 0
  • +
  • -

#3 ccrasherdeb  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 82
  • Joined: 03-March 08

Re: Using 2 Domains on 1 Account

Posted 02 September 2008 - 08:33 PM

Thanks for your reply. I checked my account and they do allow multiple domains on 1 account. What I'm trying to do is probably already set up and is just a matter of properly setting up the files and using Domain pointers that just point to the folder for each domain.

I probably just need a crash course in web host file structure and setup 101. lol

The file directory looks like this:

Home/
1........./Images
2........./XXXXX.com (2nd domain)
3............/blank.html
4............/index.html
5........./index_html
6........./public_html
7............/cgi-bin
8............/extras
9............/flash
10........../img
11........../include
12........../templates
13............/0000.html
14............/0000.html
15............/0000.html
16............/0000.html
17............/Home.html
18............/index.html
19............/robots.txt
20........../stats
21............/xxxxxxxlogo.gif

The first domain points to the home directory and displays the web site contained in the public_html folder. (home/public.html). The 2nd domain at the top of the list also pointed to the same folder until I just changed it with a domain pointer to parked. The folder for that domain at the top of the above list xxxx.com has 2 files inside, blank.html and index.html. So now after I pointed it to parked, it no longer goes to the first domain and now displays a message that says site under destruction. I also had the option to use a pointer to a sub directory but the tutorial shows that I need to choose a folder from the home page to use as the sub directory. The other domain is in the public_html folder so I cannot place the files for the 2nd domain in this folder. I am unclear where exactly to place the folder for the 2nd domain web site and how to correcly point to this folder/site.
I used a template for the first domain several months ago and will soon be replacing it with a newly created web site using dreamweaver, illustrator, indesign, photoshop and maybe flash pro among others so I wont be using the template and site package above. All the above files under the public_html folder were created by the templace package. I believe that I should create 2 folders under the home folder, 1 for each domain and then place each website with the files contained under each domain. Then use pointers for each domain to the subfolders. Im unsure whether I can create sub folders directly under the home folder which is causing some of the confusion.

Maybe someone can show me what the structure should/would look like under the Home/ folder for 2 domains using 2 different web sites.

This is probably so easy and already done for the most part and I'm making it harder than it is but for some reason I have always had trouble understanding how the above structure exactly works. I have no problem with 1 web site on 1 host or using many subdomains on 1 acct. but 2 domains on 1 host has given me a severe headache.

Thanks, any help is greatly appreciated.

This post has been edited by ccrasherdeb: 02 September 2008 - 08:43 PM

Was This Post Helpful? 0
  • +
  • -

#4 ccrasherdeb  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 82
  • Joined: 03-March 08

Re: Using 2 Domains on 1 Account

Posted 06 September 2008 - 02:51 PM

This is what I have found so far:

Current directory in the file manager:

Home/
.../www.domain2.com
....../blank.htm
....../index.htm
.../public.htm
....../(all the files are in here for www.domain1.com. This is the default home page and all other pages for domain1)


Domain2 would always default to the home page of domain1 until I changed the pointer to Parked at which point the blank.htm and the index.htm was created and now displays 'site under destruction' instead of defaulting to the home page of domain1.
Based on what I understand, the domain2 folder must be placed into the public_htm folder in the file structure and then a domain pointer is used to point at a subdomain file to display a home page for domain2. But this method shows a main domain (in this case domain1) in the page that is displayed for domain 2.

I do not want to have a so called 'Main' domain. I want the 2 separate domains to look like 2 separate domains in the file manager structure. www.domain1.com is not listed in the file manager which is how I can see that it is considered a main domain. Domain1 goes directly to the web pages inside of the public_htm folder.

The server that I'm using/renting space is an Apache server. I have very little knowledge when it comes to inserting code into the server files because I have never had the need to use an Apache server until I started working with and designing a few web sites.
The only way that I have found so far to separate the 2 domains is to use the 'URL rewriting engine' (mod_rewrite).

This post has been edited by ccrasherdeb: 07 September 2008 - 02:26 PM

Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5234
  • View blog
  • Posts: 27,024
  • Joined: 10-May 07

Re: Using 2 Domains on 1 Account

Posted 08 September 2008 - 01:32 PM

View Postccrasherdeb, on 2 Sep, 2008 - 11:33 PM, said:

Maybe someone can show me what the structure should/would look like under the Home/ folder for 2 domains using 2 different web sites.

On my server the sites are hosted from /usr/local/www/data/. Under that directory I make a directory for each site.

/usr/local/data
--> yard/
--> cdnr/

& so on. That way each sub directory has it's own index.html, robots.txt & so forth.
Was This Post Helpful? 0
  • +
  • -

#6 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Using 2 Domains on 1 Account

Posted 08 September 2008 - 01:48 PM

no2: He doesn't have root access to the server or apache configuration

mod_rewrite is definitely a valid option for this if you can't set it up easily using the tools your host provides. I don't really know what the "Domain Pointer" is you are referring to. Lots of companies tend to use their own terms for these services which can get pretty confusing. It sounds like it is just doing a regular redirect though, which will have the url end up using Domain1 instead of what you want.

Quote

I also had the option to use a pointer to a sub directory but the tutorial shows that I need to choose a folder from the home page to use as the sub directory.


This might be what you are looking for. I've admin'd cPanel and Plesk systems and they do something similar . The addon domain is a folder in your main public_html so it looks like
-home/
--/public_html/
---index.html
---/domain2/
----index.html

the first index.html is what you see if you go to domain1.com
the second index.html is what you see if you go to domain2.com . If it says select a directory in your home/ folder, then just move /domain2/ to /home/domain2/ instead of /home/public_html/domain2

If that doesn't work, mod_rewrite is pretty powerful and not very hard for what you are doing
RewriteEngine On
RewriteCond %{HTTP_HOST}% ^www.domain2.com
RewriteRule ^(.*)$  domain2/$1  [L,QSA]


Was This Post Helpful? 0
  • +
  • -

#7 ccrasherdeb  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 82
  • Joined: 03-March 08

Re: Using 2 Domains on 1 Account

Posted 08 September 2008 - 02:22 PM

Thanks for the Info.

I thought this was a common thing to do but after many hours of research, I found very little info about this.

I tried the Mod_rewrite and it worked great once I had the exact code written. I also had to create a second .htaccess file with my text editor and drop it into the root of the public_html folder, I tried removing either the .htaccess file that I placed with the Vdeck server editor or the one I created on my computer and the web sites did not work so I needed both of them.

Using the Mod_rewrite method from what I can tell sends requests from either domain directly to the index.html file called for, by-passing anything in between. All directories including the index.html are completely hidden from users so the browsers only show the xxxx.com with nothing after the .com. They show the Title of the page itself but thats it. I don't know if that's a good thing or a bad thing. I will need to change something if I want to let users access any index to go directly to a page.
The 2 domains now look completely separate and I believe that a user will not be able to tell if the 2 domains are on separate host account or served from the same account.

what I have left in my host directory is:

Home/
...public_html/
......htaccess
......vhosts/
.........domain1
............index.html
.........domain2
............index.html


and thats it, I removed everything else so I'll need to add anything else as needed.
I did not use any domain or subdomain pointers whatsoever doing it this way.
Was This Post Helpful? 0
  • +
  • -

#8 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Using 2 Domains on 1 Account

Posted 08 September 2008 - 04:16 PM

Quote

Using the Mod_rewrite method from what I can tell sends requests from either domain directly to the index.html file called for, by-passing anything in between. All directories including the index.html are completely hidden from users so the browsers only show the xxxx.com with nothing after the .com.


This is not true, depending on what flags you put in your redirect. Are you using what I wrote or something else?
Using RewriteRule, you can have
http://www.domain2.com/index.html go to
/Home/public_html/domain2/index.html

Then if you have a link to http://www.domain2.com/two.html
it goes to /Home/public_html/domain2/two.html

In both cases, the browsers url will say "http://www.domain2.com/index.html" and "http://www.domain2.com/two.html" so there is no masking going on.


mod_rewrite is an apache module, so how it works is when it receives a request for "domain2.com", it looks up what directory that should be internally. In this case the default goes to your home directory. Apache checks there for an .htaccess file and reads the rules from it. If you have any rules that match the request, it is used instead. The only thing it bypasses is your /Home/public_html/index.html file, which to the user is completely invisible and looks just like a normal request.
Was This Post Helpful? 0
  • +
  • -

#9 ccrasherdeb  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 82
  • Joined: 03-March 08

Re: Using 2 Domains on 1 Account

Posted 09 September 2008 - 12:26 PM

This is the exact code that I used except for the real domain, you can probably understand it more than me. This sends domain1 to domain1's index.html and domain2 to domain2's index.html, there is no index.html in the root of the public folder. I was told you could host 30 separate domains on 1 host with this by repeating the 3 lines of code for each additional domain.

RewriteEngine On

RewriteCond %{HTTP_HOST} domain1.com$ [NC]
RewriteCond %{REQUEST_URI} !^/vhosts/domain1/.*$
RewriteRule ^(.*)$ /vhosts/domain1/$1 [L]

RewriteCond %{HTTP_HOST} domain2.com$ [NC]
RewriteCond %{REQUEST_URI} !^/vhosts/domain2/.*$
RewriteRule ^(.*)$ /vhosts/domain2/$1 [L]

This post has been edited by ccrasherdeb: 09 September 2008 - 12:27 PM

Was This Post Helpful? 0
  • +
  • -

#10 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Using 2 Domains on 1 Account

Posted 09 September 2008 - 12:39 PM

Try adding QSA to the rewrite flags

so
RewriteRule ^(.*)$ /vhosts/domain1/$1 [L,QSA]


It should append the file part of the url to the string
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1