0

hi i am using codeigniter first time and i have to manage my URL to view URL without index.php/controller so how can i write ht access and where i keep it my folder structure as well as any other changes i have to do in my auto load or config file....

my URL is like below...

project_name/index.php/controller_name/method_name/param 1/param 2

so for this URL how can i write ht access rule?please need helpful......

  • 1
    http://www.codeigniter.com/user_guide/general/routing.html – Deep Mar 20 '15 at 06:16
  • 1
    possible duplicate of [Remove index.php From URL - Codeigniter 2](http://stackoverflow.com/questions/5155333/remove-index-php-from-url-codeigniter-2) – Shaiful Islam Mar 20 '15 at 06:19

2 Answers2

0

put this code in your .htaccess file.

RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L] 
Kavin Smk
  • 808
  • 11
  • 37
0

Open config.php and do following replaces

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

to

$config['index_page'] = ""

Just replace

$config['uri_protocol'] ="AUTO"

to

$config['uri_protocol'] = "REQUEST_URI"

AND IN HTACCESS FILE put following code

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
dhruv jadia
  • 1,684
  • 2
  • 15
  • 28