Now I am developing an application by using CodeIgniter framework
. In this application, there is a section which name account setup. By using this section we can create multiple accounts. As an example, accounts name are abc, bca or anything. And Suppose my site URL is: www.xyz.com (base_url)
Then we need to access the site by the domain name and also domain name with account name like bellow:
www.xyz.com
www.xyz.com/abc/
www.xyz.com/bca/
www.xyz.com/anything/
For More clear, URL pattern will be:
www.xyz.com/dashboard/index
www.xyz.com/abc/dashboard/index
www.xyz.com/bca/dashboard/index
How can we do it? I need your suggestion.
Yes it's Possible through codeigniter Routs. Go to
application\config
Open a file which Name is routes.php you can call the controller functions see in code exampleexample
when you hit your website url like this
www.xyz.com/new_project
it will go to your mention controller and function.see the documentation of routs CodeIgniter URI Routing
example 2:
Now we you redirect your url like this
Now your url look like this.
Also you can use this like this.
And then you can call it like this.
And from this code your output url show something like this.
Hope it will help you if any question add comment