![]() |
How to do subdomains with Codeigniter and Nginx? - 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: How to do subdomains with Codeigniter and Nginx? (/showthread.php?tid=57325) |
How to do subdomains with Codeigniter and Nginx? - El Forum - 03-06-2013 [eluser]tim peterson[/eluser] I'd like to have various subdomains on my site such as this: biology.mysite.com Currently I have the following code in my nginx.conf: Code: server { This code works in that if you point the browser to biology.mysite.com, it redirects to mysite.com/tags/biology and the correct biology content loads. However, I don't want to redirect the url but want the subdomain to remain the url. So instead I replaced the above with the code below based on [this gist][1] but it has no effect (meaning pointing to biology.mysite.com simply goes to mysite.com): Code: if ($host ~* ^www\.([a-z0-9]*)\.(mysite\.com) ) Thoughts? [1]: https://gist.github.com/lynxluna/1050850 |