Getting CI up and running is rather simple. Most of it requires you to edit a few configuration
files.
You need to setup CI to point to the right base URL of the app. To do this, open up system/application/config/config.php and
edit the base_url array item to point to your server and CI folder.
view plaincopy to clipboardprint?
$config['base_url'] = "http://localhost/ci/";
Currently, the CI setup will have a default controller called “welcome.php”; you can find this in the system/application/controllers folder. For this tutorial, delete it and open your system/application/config/routes.php file. Change the default array item to point to the “helloworld” controller.
view plaincopy to clipboardprint?
$route['default_controller'] = "Helloworld"
CI also has a view file that we do not need. Open up the system/application/view/ folder
and delete the welcome_message.php file.
You can change your default controller here.
In order to edit Url http://localhost/ci/index.php/helloworld/
.There are a few things you can do to improve your CodeIgniter experience -
like removing that annoying index.php bit out of the URL. You can accomplish this task by creating a .htaccess file in the root folder, and adding the following code.
RewriteEngine on
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^(.*)$ ci/index.php/$1 [L]
You’ll also need to open up the config.php file in system/application/config/ and edit the index_page array item to a blank string.
view plaincopy to clipboardprint?
$config['index_page'] = "";
Another nifty trick is to turn on CI’s ability to parse PHP alternative syntax if its
not enabled by the server. To do this, open up the same file as before, system/application/config/config.php, and set the rewrite_short_tags array item to TRUE.
view plaincopy to clipboardprint?
$config['rewrite_short_tags'] = TRUE;
I hope all goes well!