-2

Guys I need help I have hosted the website on Ipage Server. I have uploaded the PHP development of the website and extracted the same. Have also created a copy of the Controller files outside the applications folder. But there is a issue here. Whenever I try to view my website in browser-> www.example.com it redirects me to the below page .

====

CODING

Welcome to CodeIgniter! The page you are looking at is being generated dynamically by CodeIgniter.

If you would like to edit this page you'll find it located at:

application/views/welcome_message.php The corresponding controller for this page is found at:

application/controllers/welcome.php If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

Page rendered in 0.0133 second

And I am able to see my website only when i try to view as -> www.example.com/index.php/Home .... [Home is the name of my website controller]

Nikz
  • 11
  • 1
  • 2
    You need to set routes in app/Config/route.php further, you can see http://naveedramzan.com/codeigniter-url-rewriting/ – Naveed Ramzan Jan 25 '16 at 07:11
  • There area two reserved routes: | | $route['default_controller'] = 'welcome'; | | This route indicates which controller class should be loaded if the | URI contains no data. In the above example, the "welcome" class | would be loaded. | | $route['404_override'] = 'errors/page_missing'; | | This route will tell the Router what URI segments to use if those provided | in the URL cannot be matched to a valid route. | */ $route['default_controller'] = "Home"; $route['404_override'] = ''; /* End of file routes.php */ /* Location: ./application/config/routes.php */ "404 Page cannot be found. – Nikz Jan 27 '16 at 04:03

2 Answers2

0

Go to application/config/routes.php and set your default controller. By default it's "welcome" controller

change

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

to

$route['default_controller'] = "your_controller_name"; // home
Rakesh Sharma
  • 13,680
  • 5
  • 37
  • 44
  • There area two reserved routes: | | $route['default_controller'] = 'welcome'; | | This route indicates which controller class should be loaded if the | URI contains no data. In the above example, the "welcome" class | would be loaded. | | $route['404_override'] = 'errors/page_missing'; | | This route will tell the Router what URI segments to use if those provided | in the URL cannot be matched to a valid route. | */ $route['default_controller'] = "welcome"; $route['404_override'] = ''; /* End of file routes.php */ /* Location: ./application/config/routes.php */ where to change ? – Nikz Jan 25 '16 at 07:41
0

Inside application/config/routes.php, set your controller name to default controller.

$route['default_controller'] = "put your controller name";

monita
  • 1
  • 1