I have created a Home page controller with a Page method so that it can load inner page views. So I simply pass the Page name as an argument to Page method and it loads that specific view.
E.g.
http://www.mywebsite.com/home/page/copyright
So here
1. home is controller
2. page is method
3. copyright is the parameter passed to page() method
So the home age loads simply using this URL
http://www.mywebsite.com/home/
and inner pages load using this url pattern
http://www.mywebsite.com/home/page/copyright
Now I want to load inner pages so that suppose I use this URL
http://www.mywebsite.com/copyright
it should load the page from
http://www.mywebsite.com/home/page/copyright
How can I do this using Codeigniter Route method or by using .htaccess file ?
Thanks in advance.
On your application/config/routes.php :
Even better:
So if you navigate to http://www.domain.com/copyright it routes to home/page/copyright
If you navifate to http://www.domains.com/anything it routes to home/page/anything
EDIT to catch any route
Although in this case you have to “catch” pages that you don t route like: