homepage Welcome to WebmasterWorld Guest from 54.196.207.55
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
httpd.conf settings for domain parking site
need help with the config lines
adrianTNT




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

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]

 

uncobeth




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

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?

adrianTNT




msg:3847532
 10:31 pm on Feb 11, 2009 (gmt 0)

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.

uncobeth




msg:3847654
 2:14 am on Feb 12, 2009 (gmt 0)

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

adrianTNT




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

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.

adrianTNT




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

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?

uncobeth




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

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?

phranque




msg:3850330
 1:43 am on Feb 16, 2009 (gmt 0)

you might be better off posting your question in the Apache Web Server forum [webmasterworld.com].

adrianTNT




msg:3850343
 2:00 am on Feb 16, 2009 (gmt 0)

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]

phranque




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

(.*)\.(.*)

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

adrianTNT




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

ok, using yours then. Thank you.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved