Welcome Guest, Not a member yet? Register   Sign In
How can I remove the controller name from url ??

.txt   htaacess.txt (Size: 171 bytes / Downloads: 77)
.txt   config.txt (Size: 17.92 KB / Downloads: 92)
.txt   site.txt (Size: 712 bytes / Downloads: 72)
.txt   route.txt (Size: 111 bytes / Downloads: 77)


I want to access my page like--> http://localhost/basicsite/home

currently I am getting it as-->  http://localhost/basicsite/site/home


I want to access my page like-->   http://localhost/basicsite/about

currently I am getting it as-->   http://localhost/basicsite/site/about

"site" is the name of controller .

I want to remove that "site" (name of controller) from URL

how to achieve it please help me with this .

those attachments are there showing required files you may want to know .

attachments are
1- htaccess file   ("at / root folder")
2- config.php     ("application/config/config.php")
3- site.php         ("application/controller/site.php")
4- routes.php    ("application/config/routes.php")


(This post was last modified: 10-07-2015, 04:15 AM by freddy.)

how long did you know ci ?

so here is i give simple tutorial about your issue

$route['home'] = 'site/home';
$route['about'] = 'site/about';

<h1>Here is website</h1>
<a href="<?php echo site_url('home') ?>">Home</a>
<a href="<?php echo site_url('about') ?>">about</a>

defined('BASEPATH') OR exit('No direct script access allowed');

class Site extends CI_Controller {

public function index()

public function home()
echo "home";


public function about()
echo "about";


Hope this make sense, i give attachment, my condition is without index.php.

Attached Files
.zip   site.zip (Size: 2.03 KB / Downloads: 48)

Theme © iAndrew 2016 - Forum software by © MyBB