Search code examples
phpcodeignitercodeigniter-urlcodeigniter-routing

multi user website in codeigniter


I want to build a multi user website where my users register and their account is created.

After sign up the user gets a specific url to build his website. Like. Mysite.com/user1

Now the user can login to the control panel and publish his data. Eg he has created a faq page.

His faq page should be available like

Mysite.com/user1/faq

I've done everything but this faq page building does not work at all.

I check the user for existence in the DB and route to his page in the routes.php file :any = home/loader/$1

And in loader.php I fetch the details and display his welcome page, for the faq page, I have created a function in the loader.php controller as Faq() And built a custom view for it but now when I try to access the page it only loads the welcome page. I tried all methods but it does not work.


Solution

  • I suggest you have a look at the Tutplus

    http://code.tutsplus.com/tutorials/basecamp-style-subdomains-with-codeigniter

    It explains how to work with wildcard routing in codeigniter