droliff
01-17-2009, 11:15 PM
Hi all,
I came here for a solution to, what I initially was referring to as 'virtual hosting' but have since learned it is called an Apache mod rewrite.
Condensing the story, a short time ago I registered a domain name, we'll call it domain_B.com, for a club that I am in, so that I could host a website on my Verio.com hosting plan (where I have my primary domain registration, domain_A.com (http://dennisroliff.com/folio) for my business website). I registered with GoDaddy because I didn't know it would be easier to register through Verio. Anyway after correcting the A records and DNS records on the the Godaddy domain_B.com control panel to point it to my Verio server I came here for advice on an Apache mod rewrite solution to direct domain_B.com traffic to a folder in my Verio server root directory named domain_B.com. R Medek and Schleppel gave me codes to place into a .htacces file in the root directory of my server that worked. Medek's was a bit simpler so I am currently using that:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain_B.com$
RewriteCond %{REQUEST_URI} !domain_B.com/
RewriteRule ^(.*)$ domain_B.com/$1
Here's my current situation and question:
I just registered another domain name, we'll call domain_C.com. I would like to do the same thing that I did with domain_B.com and host that site on my Verio hosting plan.
This time I registered through Verio so the A and DNS records were all correct. I placed a folder named domain_C.com in the root directory of my server. I then wrote the following code in my .htaccess file:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain_B.com$
RewriteCond %{REQUEST_URI} !domain_B.com/
RewriteRule ^(.*)$ domain_B.com/$1
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain_C.com$
RewriteCond %{REQUEST_URI} !domain_C.com/
RewriteRule ^(.*)$ domain_C.com/$1
When I typed domain_C.com into my browser address bar, it searched but could not find the server for domain_C.com.
I figured the code in the .htaccess file that worked for one domain should work for another.
Does it take a certain amount of time after one registers a domain for it to start working. I've only just registered domain_C.com a couple hours ago.
I've tried the above code in the .htaccess file with no space in between blocks of code (domain_B works, domain_C doesn't), I've tried putting the domain_C code first, same result.
Any suggestions or input?
Thanks in advance.
Dennis
I came here for a solution to, what I initially was referring to as 'virtual hosting' but have since learned it is called an Apache mod rewrite.
Condensing the story, a short time ago I registered a domain name, we'll call it domain_B.com, for a club that I am in, so that I could host a website on my Verio.com hosting plan (where I have my primary domain registration, domain_A.com (http://dennisroliff.com/folio) for my business website). I registered with GoDaddy because I didn't know it would be easier to register through Verio. Anyway after correcting the A records and DNS records on the the Godaddy domain_B.com control panel to point it to my Verio server I came here for advice on an Apache mod rewrite solution to direct domain_B.com traffic to a folder in my Verio server root directory named domain_B.com. R Medek and Schleppel gave me codes to place into a .htacces file in the root directory of my server that worked. Medek's was a bit simpler so I am currently using that:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain_B.com$
RewriteCond %{REQUEST_URI} !domain_B.com/
RewriteRule ^(.*)$ domain_B.com/$1
Here's my current situation and question:
I just registered another domain name, we'll call domain_C.com. I would like to do the same thing that I did with domain_B.com and host that site on my Verio hosting plan.
This time I registered through Verio so the A and DNS records were all correct. I placed a folder named domain_C.com in the root directory of my server. I then wrote the following code in my .htaccess file:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain_B.com$
RewriteCond %{REQUEST_URI} !domain_B.com/
RewriteRule ^(.*)$ domain_B.com/$1
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain_C.com$
RewriteCond %{REQUEST_URI} !domain_C.com/
RewriteRule ^(.*)$ domain_C.com/$1
When I typed domain_C.com into my browser address bar, it searched but could not find the server for domain_C.com.
I figured the code in the .htaccess file that worked for one domain should work for another.
Does it take a certain amount of time after one registers a domain for it to start working. I've only just registered domain_C.com a couple hours ago.
I've tried the above code in the .htaccess file with no space in between blocks of code (domain_B works, domain_C doesn't), I've tried putting the domain_C code first, same result.
Any suggestions or input?
Thanks in advance.
Dennis