View Full Version : Domain Parking?
jhobbs
12-29-2003, 10:04 AM
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?
loopforever
12-29-2003, 10:49 AM
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.
DirectAdmin Support
12-29-2003, 11:11 AM
Hello,
You could always just do the following:
create domain2.com as if it were a normal domain.
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
loopforever
12-29-2003, 11:30 AM
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.
DirectAdmin Support
12-29-2003, 11:59 AM
Or, even easier than that...
Use the "custom httpd.conf" feature and add
ServerAlias www.domain2.com domain2.comto the settings for domain.com. (Admin Panel -> Admin Settings -> custom httpd.conf -> domain.com)
:)
John
loopforever
12-29-2003, 12:03 PM
What is this? A competition? :p
DirectAdmin Support
12-29-2003, 12:07 PM
:D
jhobbs
12-29-2003, 07:18 PM
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?
loopforever
12-30-2003, 07:55 AM
Try this, but replace username and domain.com as needed:
RewriteEngine on
RewriteRule ^/$ /home/username/domains/domain.com/public_html/ [R]
jhobbs
12-30-2003, 09:24 AM
: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/
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.