peterbasutkar Posted July 9, 2017 Share Posted July 9, 2017 (edited) Hi , Requirement : Different eshop/websites to refer one source which is connecting to different databases based on domain Environment : Cloud Linux , easy apache , php , mysql , cPanel/WHM Description : We are having two eshops , abc.shop.com(dbname : abc) should connect to databse abc and apache should refer common source located at /home/<directory-source-code> and def.shop.com(dbname : def) should connect to databse def and apache should refer common source located at /home/<directory-source-code> In Short both the eshops/websites are having common source code but connecting to different databases Trial and Analysis : we have virtual host entries in apache , i changed document root location for both the websites and permission also i tried with enabling and disabling cache also , but getting error attached is there any way to achieve one source code and multiple databases for each websites using prestashop 1.7 Edited July 9, 2017 by peterbasutkar (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted July 9, 2017 Share Posted July 9, 2017 (edited) deleted post.... I had the idea of using htaccess to redirect your db config file according to domain to a domain spefific setting. However this wouln't work since php require or include commands are direct file access command and don't go through the apache server. Second problem is see: There are many files stored on your storage once you set up your shop. For example product images, logos etc etc. If you would use one source code but two databases this would immediately lead to problems. Example: You add your first product images in database A. This product gets die product id 1. Hence, all images are linked to a path including the product id 1. If you add the first product image in database B, it would also get the product id 1. Hence, the first image would be overwritten. Similar problems would follow at different places. Edited July 9, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now