Question

I am trying to set up 2 different domains in two different folders, first one say

www.test-one.co.uk

which point to /home/test1/public_html and other

www.test-two.co.uk

which point to /home/test2/public_html. www.test-one.co.uk is the base one. Multiple store and website all are created. Now the problem is we cant point www.test-two.co.uk to the doc-root of test-one.co.uk, because both are pointed to different folders as shown above.

Also thought of doing parked domain way to point, but since second website got certain mailid, dropped that idea.

Another option is to point via httpd.conf and point test-two site to primary site folder.

Is there any better way to handle this case? Without being copied index.php and .htaccess to second site folder and editing same.

Could somebody drop some light towards my issues

Was it helpful?

Solution

Never Mind. We fixed ourself.

We cant add virtual host redirect in httpd.conf, as we got cpanel, when it restarts, all that we written will be lost.

So we tried an alternate way to include another .conf file in httpd.conf and we succeeded. The second domain pointed to first.

But next we met with another issue. We always got 500 internal server error page when taking second domain. So we checked the error log and we found this error

[Wed Oct 28 06:28:00 2015] [error] [client ip] SoftException in Application.cpp:422: Mismatch between target UID (505) and UID (501) of file "/public_html/index.php"
[Wed Oct 28 06:28:00 2015] [error] [client ip] Premature end of script headers: index.php

This is because of the different ownership of two domains. So for fixing this, we written to assign owner ship of first domain for second in the custom included .conf file.

Problem solved and we are ready to shoot. :)

Might be helpful for someone in future, so posted these.

OTHER TIPS

One point to add here related to 500 internal server error and different ownership. In your second website .conf file add:

suPHP_UserGroup firstwebsiteuser firstwebsiteuser

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top