![]() |
Multiple domains with one codebase - how to set htaccess file? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Multiple domains with one codebase - how to set htaccess file? (/showthread.php?tid=72966) |
Multiple domains with one codebase - how to set htaccess file? - einav - 03-06-2019 Hi, I have multiple domains (two at the moment, but might be more later on), and I want them all to use the same CodeIgniter codebase, but each domain will use its own database. I have the basic concept figured out (I hope), but the only thing I'm struggling with is the htaccess file. I want it to handle the removal of index.php from the url, as well as redirect to https and www. Below is my .htaccess file. On localhost it works well, but on the remote servers it creates an seemingly endless chain of index.php/index.php/index.php etc. What am I missing here? If it matters, I'm using CI 3.1.9 Code: RewriteEngine On RE: Multiple domains with one codebase - how to set htaccess file? - Krycek - 03-06-2019 I did it in a slight different way. In DirectAdmin I created different domains (lets say for now domain1.com and domain2.com). Then when I login into FTP, I got the following structure /domains /domains/application /domains/domain1 /domains/domain1/public_html /domains/domain2 /domains/domain2/public_html /system Then I placed the index.php in every public_html and defined some CONSTANTS with the database connection details (host, user, pwd and port). Also all index.php points to the same application and system directory. If I update the application or system folder, every project gets the update. |