• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to remove index.php in my URL

#1
Exclamation 
Dear All
i don't want to show index.php in URL.
how can i call my controller without calling index.php.
for example
i want call my controller like ...

http://localhost/CodeIgniter-3.0.0/HomeController

instead of

http://localhost/CodeIgniter-3.0.0/index.php/HomeController


somebody give following .htaccess file but it's not working. it shows 500 internal error.

------------.htaccess---------------

RewriteEngine on
RewriteCond %(REQUEST_FILENAME)  !-f
RewriteCond %(REQUEST_FILENAME)  !-d
RewriteRule .* index.php/$0 [PT,L]
----------------------------------

looking forward
Thanks in advance
Reply

#2
here is is mine

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


then goes to your config/config.php

find

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

change to be
Code:
$config['index_page'] = '';
Reply

#3
Wow...
Thanks it's working..Smile
Reply

#4
Same as previous post but here are the docs for it:

http://www.codeigniter.com/userguide3/general/urls.html

PS You have () instead of {} in your version.
Reply

#5
500 is a server error not a CI error, check your server setup.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#6
If you didn't know how to do this, you might want to give the user guide a thorough reading since it's covered in there. I'm sure there's a lot of other things you are unaware of, which would probably be very helpful.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.