Codeigniter setup for subdomains sharing one template
Basically what I want to have is several subdomain all running off one CI install so they can share a common template. Each subdomain website will be different from each other with their own pages and functions.
Logging in across the subdomains is not a requi开发者_如何转开发rement, but I’d like to keep my options open.What is the best way of going about doing this?
Thanks, OwenBy templates do you just mean view files or do you mean actual Template library specific views? If you use my Template library you can configure the locations of theme folders, but as for view files that is more difficult.
Packages in CI 2.0 support the sharing of various files like models, helpers, libraries, etc but this does not support view files. This is an upcoming feature that might make it into 2.0.1 depending on the release schedule, but for now you'll have to create a symlink in one directory to link to another.
This is the approach you should take.
- Have the installation at xyz.com
- All requests with subdomain should be rewritten with the help of .htaccess
Eg d1.xyz.com should be rewritten to xyz.com/?customer=d1 - You can in your script use the get variable d1 to do the manipulations with templates
精彩评论