CodeIgniter Forums

Full Version: Controller as subdomain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]TheIgniter[/eluser]
Hi there,

First of all, i thank the codeigniter's developpers for this great application!

I want to know if it's possible to make the controller as a subdomain .. Like,
Code:
mysite.com/controller/method become controller.mysite.com/method.

Best Regards,

v1R.

El Forum

[eluser]pickupman[/eluser]
This should work using .htaccess. You will need to create a rewrite for the hostname to match the subdomain and hostname. Rewrite controller.mysite.com/method to mysite.com/controller/method
For the exact syntax look it up on google for some examples.