Codeigniter URI Routing -


i have check codeigniter user guide, not lucky solve problem.

i have created webpage on localhost.

when go http://localhost/webpage/ okay. go default controller.

my default controller homepage , there methods named index, guarantee , about

when go routes.php, added this:

$route['guarantee'] = "homepage/guarantee"; $route['about_us'] = "homepage/about"; 

then try access http://localhost/webpage/guarantee , http://localhost/webpage/about_us show error 404

but when $route['default_controller'] = "homepage/guarantee"; guarantee page displayed.

can me issue? thanks.

you need remove index.php. in application/config.php file change

$config['index_page'] = 'index.php'; 

to

$config['index_page'] = ''; 

then put .htaccess file in root folder (in same folder index.php is:

options -indexes options +followsymlinks  # set default file indexes directoryindex index.php  <ifmodule mod_rewrite.c>      # activate url rewriting: rewriteengine on  # not rewrite links documentation, assets , public files rewritecond $1 !^(uploads|assets|js|css|images|img)       # rewrite else     rewriterule ^(.*)$ index.php/$1 [l] </ifmodule>  <ifmodule !mod_rewrite.c>     # if don't have mod_rewrite installed, 404's     # can sent index.php, , works normal.     errordocument 404 index.php </ifmodule>   

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -