Welcome to WebmasterWorld Guest from 54.167.110.211

Forum Moderators: bakedjake

Message Too Old, No Replies

httpd.conf settings for domain parking site

need help with the config lines

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

Full Member

5+ Year Member

joined:Sept 21, 2006
posts: 211
votes: 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]

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

New User

5+ Year Member

joined:Dec 18, 2007
posts: 22
votes: 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?
10:31 pm on Feb 11, 2009 (gmt 0)

Full Member

5+ Year Member

joined:Sept 21, 2006
posts: 211
votes: 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.
2:14 am on Feb 12, 2009 (gmt 0)

New User

5+ Year Member

joined:Dec 18, 2007
posts: 22
votes: 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

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

Full Member

5+ Year Member

joined:Sept 21, 2006
posts: 211
votes: 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.

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

Full Member

5+ Year Member

joined:Sept 21, 2006
posts: 211
votes: 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?

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

New User

5+ Year Member

joined:Dec 18, 2007
posts:22
votes: 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?
1:43 am on Feb 16, 2009 (gmt 0)

Administrator

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

joined:Aug 10, 2004
posts:10550
votes: 10


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)

Full Member

5+ Year Member

joined:Sept 21, 2006
posts: 211
votes: 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]

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

Administrator

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

joined:Aug 10, 2004
posts:10550
votes: 10


(.*)\.(.*)

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

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

Full Member

5+ Year Member

joined:Sept 21, 2006
posts: 211
votes: 0


ok, using yours then. Thank you.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members