Book Image

CodeIgniter Web Application Blueprints

Book Image

CodeIgniter Web Application Blueprints

Overview of this book

Table of Contents (16 chapters)
CodeIgniter Web Application Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adjusting the routes.php file


We want to redirect the user to the discussions controller rather than the default CodeIgniter welcome controller. To do this, we will need to amend the default controller setting in the routes.php file to reflect this, which can be done as follows:

  1. Open the config/routes.php file for editing and find the following lines (near the bottom of the file):

    $route['default_controller'] = "welcome";
    $route['404_override'] = '';
  2. Firstly, we need to change the default controller. Initially in a CodeIgniter application, the default controller is set to welcome; however, we don't need this. We want the default controller to be discussions instead. So, find the following line:

    $route['default_controller'] = "welcome";

    Change it to the following:

    $route['default_controller'] = "discussions";