Domain Parking?

jhobbs

Verified User
Joined
Dec 17, 2003
Messages
8
WHM/CPanel allows simple "domain parking":
I have Domain1, and can park Domain2, 3, 4 & 5 on top of Domain1. When I go to Domain2's URL in a browser, the browser's address says Domain2, even though the content was created for Domain1 (works so long as relative addressing is used in site design).

Using DirectAdmin I can get something similar, but if I navigate to Domain2, the browser says Domain1.

How can I get "domain parking" via DirectAdmin?
 
You can use an .htaccess file in Domain2's (3..4..5..etc) public_html directory and use mod_rewrite to redirect them to Domain1. Just "Add Additional Domains" in the user panel, and add the same .htaccess file in each domain's public_html directory.
 
Hello,

You could always just do the following:

create domain2.com as if it were a normal domain.
Code:
cd /home/username/domains
rm -rf domain2.com
ln -s domain.com domain2.com
This will point the document root to domain.com from domain2.com to give you the result you're looking for.

John
 
Or, even easier than that...

Add your additional domains as vhosts in httpd.conf and set their DocumentRoot directive to the public_html directory of Domain1. This way you don't even have to make the additional domains in DA.
 
Or, even easier than that...

Use the "custom httpd.conf" feature and add
Code:
ServerAlias [url]www.domain2.com[/url] domain2.com
to the settings for domain.com. (Admin Panel -> Admin Settings -> custom httpd.conf -> domain.com)

:)

John
 
Glad to see the competition for the best answer!!!

But I don't have Admin access to anything, just Reseller & Root. I couldn't find "Custom httpd conf" anywhere. I couldn't even find it in DirectAdmin's site-helper for Admins.

I get the general idea that I should modify .htaccess to include a mod_rewrite command. Is it as simple as creating a one-line file, and placing it in the public_html directory of the new domain?

Would someone be kind enough to show me the contents such a file, and any appropriate suggestions?
 
Try this, but replace username and domain.com as needed:

Code:
RewriteEngine on
RewriteRule   ^/$  /home/username/domains/domain.com/public_html/  [R]
 
:confused: Failure.... Forgot to Refresh! :rolleyes:

:) Current Status: Success, after Refreshing! :)

:D Thanks for everybody's help!!!

There was a .htaccess file in /domains/domain2.com/public_html
that contained Redirect / http://domain1.com. I'm guessing this line was installed by DA.

I modified the file to
Redirect / http://domain1.com
RewriteEngine on
RewriteRule ^/ $ /home/userid/domains/domain1.com/public_html/
 
Last edited:
Back
Top