Welcome to WebmasterWorld Guest from 54.145.235.72

Forum Moderators: bakedjake

httpd.conf settings for domain parking site

need help with the config lines

   
12:45 am on Feb 2, 2009 (gmt 0)

5+ Year Member



Hello.
I have a domain where I want to host more sites, like a parking domain.
For example fooparking.com...

How should the httpd.conf of fooparking.com look like if I want all my parked domains to show content from main domain?!

For example:
domain1.com will show contents from fooparking.com/domain1.com/
domain2.com will show contents from fooparking.com/domain2.com/
domain3.com will show contents from fooparking.com/domain3.com/

Any help is greatly appreciated, thank you.

[edited by: adrianTNT at 12:46 am (utc) on Feb. 2, 2009]

10:03 pm on Feb 11, 2009 (gmt 0)

5+ Year Member



In httpd.conf, you can set the DocumentRoot to the directory of the main domain. Is that what you meant, or do you need an example of the directive to use?
10:31 pm on Feb 11, 2009 (gmt 0)

5+ Year Member



Thanks uncobeth, I managed to do it somehow, by setting document root in httpd.conf to point to main domain root (as you said), then a htaccess in that domain redirects all traffic to subdirectories.
2:14 am on Feb 12, 2009 (gmt 0)

5+ Year Member



Hi Adrian,

You can also just set the DocumentRoot to those subdirectories so you don't have to put the directives in the .htaccess file.

Example: DocumentRoot /var/www/html/domain1.com

Beth

8:26 pm on Feb 12, 2009 (gmt 0)

5+ Year Member



I fixed it for now, but if anyone else needs it you can also set the domain root dinamically for all domains like this (in httpd.conf):

UseCanonicalName off
VirtualDocumentRoot /home/public_html/domains/%0

%0 represents the domain name.

12:42 am on Feb 16, 2009 (gmt 0)

5+ Year Member



I have an issue with the code I use:
for both domain1.com and www.domain1.com I want to get content from /domains/domain1.com (exclude the "www" if it is there). I tried this:

RewriteCond %{HTTP_HOST} ^([^.]+\.[a-z]{2,6})$ [NC]
RewriteRule ^(.*)$ /domains/%1/$1 [L]

RewriteCond %{HTTP_HOST} ^www.([^.]+\.[a-z]{2,6})$ [NC]
RewriteRule ^(.*)$ /domains/%1/$1 [L]

But only one at a time works, whenever the two conditions are both existent the second one returns "Internal Server Error".
Anyone knows what is wrong or what to use instead?

1:36 am on Feb 16, 2009 (gmt 0)

5+ Year Member



I'm really, really bad at writing rules. I've had some wonderful people help me with them on here. Why not go ahead and start a new thread with a new subject so people can find it more easily?
1:43 am on Feb 16, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



you might be better off posting your question in the Apache Web Server forum [webmasterworld.com].
2:00 am on Feb 16, 2009 (gmt 0)

5+ Year Member



I had 2 other posts that ware moved/forwarded so it would be a bad idea to start another one there now.

I got to this and seems to be working ok:

RewriteCond %{HTTP_HOST} ^(www.)?(.*)\.(.*)$ [NC]
RewriteRule ^(.*)$ /domains/%2.%3/$1 [L]

[edited by: adrianTNT at 2:01 am (utc) on Feb. 16, 2009]

2:14 am on Feb 16, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



(.*)\.(.*)

.* is "ambiguous, greedy, and promiscuous".
it would be better to instead use this:
([^.]*)\.(.*)

2:23 am on Feb 16, 2009 (gmt 0)

5+ Year Member



ok, using yours then. Thank you.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month