![]() |
Multiple Parked Domains - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Multiple Parked Domains (/showthread.php?tid=4954) Pages:
1
2
|
Multiple Parked Domains - El Forum - 12-26-2007 [eluser]richman[/eluser] Hi Everyone, I have a strange question, I really hope somebody has an answer. Basically I have built a website and the site is made up of 5 different sections. Lets call them www.mainsite.com/section1 www.mainsite.com/section2 www.mainsite.com/section3 www.mainsite.com/section4 www.mainsite.com/section5 each sections is bascically a controller. Thats easy enough, but each section has its own domain name and these are parked ontop of www.mainsite.com My question is what is the best way to make each parked domain point to its respective sub section, eg www.section1.com should go to www.mainsite.com/section1 Any help would be Great Rich Multiple Parked Domains - El Forum - 12-26-2007 [eluser]John Fuller[/eluser] I am doing something like that. I have a basic management app which controls a bunch of domains I own. Read about managing applications for info on running multiple websites on one installation of CI. I have one application called "admin" which contains apps such as content managers and other features which update a central database that all apps are connected to. For instance, I have a dashboard with all my sites listed and I can select one from the list which brings me to a weblog form which will post to that particular site. Some items can be contained within the admin application but of course others have to be duplicated across all sites. For instance, I have a contact form app which requires views and controllers for each site. Of course, the views for each site also have to be stored in the view folder for that particular site. That is all fine though. Because this is a basic parking system with the ability to do simple things with the sites I can just create a basic bundle which all sites will use and then duplicate that bundle across all sites. Eventually my admin app will automatically create the bundles for each site I setup in the control panel. I could even create some sort of update feature which will refresh all bundles to reflect updates made to a master bundle. Multiple Parked Domains - El Forum - 12-26-2007 [eluser]richman[/eluser] Thanks John, I understand what you have done and read the userguide. Basically if I show you the site it may make more sense. At the moment the site is on a development server at www.atp-development.com Please note each sub section is only a contoller with the functions being the pages. Once we move the site over to the live server the sub sections being cairns/darwin ect ect already have there own domain names, but due to the fact that the I have combined all the pre-existing sites into 1 main website, I need away for the parked domain names to point the relevent sections which would be www.themainwebsite.com/darwin ect. Does this make sense. Your help is very much appreciated. Rich Multiple Parked Domains - El Forum - 12-26-2007 [eluser]John Fuller[/eluser] Right, I guess my explanation was more of an alternative way of handling parked domains rather than a straight answer to your question. Really my method is not much different from yours. Each site has its own controllers but they are just in different locations from where you have yours. Why not just use that doc I linked to? It works out of the box and there is no heavy thinking or modification involved. ![]() I just setup each site as I would with any site and then dropped in an index.php file that points back to the main CI installation. Multiple Parked Domains - El Forum - 12-26-2007 [eluser]John Fuller[/eluser] Are you just looking for an htaccess redirect? Multiple Parked Domains - El Forum - 12-26-2007 [eluser]richman[/eluser] Hi John, I guess that was one of the options I was maybe going to look at doing the work in the htaccess, or perhaps writing a hook and looking at the domain name and redirecting to the relevant section of the site. I had a go at the htaccess but could not get it to work. Would you be able to help out with this? Rich Multiple Parked Domains - El Forum - 12-26-2007 [eluser]John Fuller[/eluser] What happened with the redirect? That is how I have some of my domains parked at Sedo. I am just doing a 302 redirect to sedoparking.com/domain.com using an htaccess as described here. Multiple Parked Domains - El Forum - 12-26-2007 [eluser]esra[/eluser] Do a search on the web for 'wildcard domain redirection code'. You should come up with some hits. Alternatively, download a copy of Postnuke. Postnuke includes a module called multisite, but this module only contains sample files and instructions for implementing multisite. However, if the multisite module is initialized (enabled), the bootstrap loader (index.php) invokes wildcard subdomain redirection (an Apache feature that is enabled on hosts supporting subdomains). The Postnuke solution handles both domains and subdomains. The only setup file required includes a list of domains with code for stripping off the www. and .com parts of the domain (e.g., www.domain.com becomes domain). In te case of subdomains, the subdomain name remains and the domain name is stripped off. A special directory is created to store subdirectories using the subdomain or domain name (whatever is the case). Those subdirectories usually only contain a template subdirectory and config file. You would have to adapt the general approach to using the CI file system. Multiple Parked Domains - El Forum - 12-26-2007 [eluser]John_Betong[/eluser] Hi RichMan, I have three domains all pointing to the same URL. I check for the ($_SERVER['SERVER_NAME']) and set the $application_folder to the appropriate domain as you can see from the index.php code snippet. index.php Code: ... Here is a link to the menu system. Cheers, John_Betong Updated speling miistakes Multiple Parked Domains - El Forum - 12-26-2007 [eluser]richman[/eluser] Hi Everyone, Thanks for all your replies, I managed to find a solution using 302 redirects. I found a tutorial at http://www.vladimirated.com/web-development-seo-redirecting-parked-domains-to-main-one-using-htaccess It was really good for a .htaccess novice. Rich |