CodeIgniter Forums
[SOLVED] delete index.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: [SOLVED] delete index.php (/showthread.php?tid=70626)



[SOLVED] delete index.php - davy_yg - 05-05-2018

I forget how to set up the .htaccess so that index.php does not appears in the url:

This is what I try:

.htaccess


Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]


config.php

Code:
$config['index_page'] = '';

Yet, I have not been successful.  I still have to write the index.php in order to make it works.


RE: delete index.php - InsiteFX - 05-05-2018

It's in the User's Guide.


RE: delete index.php - davy_yg - 05-05-2018

I finally find the link:

https://www.codeigniter.com/user_guide/general/urls.html

I already copy and paste this to the .htaccess file

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

and still I have to type the index.php to make it works.


RE: delete index.php - dsivic - 05-05-2018

turn on mod_rewrite


RE: delete index.php - bangbangda - 05-05-2018

1.httpd.conf file. set "AllowOverride" to "All"
2.Confirm mod_rewrite.so is on.
3. restart apache


RE: delete index.php - davy_yg - 05-05-2018

I don't understand in my xampp:

httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so

<Directory />
AllowOverride All
Require all denied
</Directory>

<Directory "C:/xampp/cgi-bin">
AllowOverride All
Options None
Require all granted
</Directory>

AllowOverride All


The first one earlier is set to none, I already change it to all, save it and restart apache. Still I have to put index.php to make it works.


RE: delete index.php - davy_yg - 05-06-2018

This one solved. I simply have to put .htaccess on the root folder of CI.