CodeIgniter Forums
Code to delete index.php in Codeigniter 3 and lowercase name to controllers/models - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forum-1.html)
+--- Forum: Lounge (https://forum.codeigniter.com/forum-3.html)
+--- Thread: Code to delete index.php in Codeigniter 3 and lowercase name to controllers/models (/thread-62241.html)



Code to delete index.php in Codeigniter 3 and lowercase name to controllers/models - bonifacio - 06-23-2015

I've done some web pages codeigniter 3 everything runs perfect in a local environment , but when I load it on a web server and have some problems:

I've done some web pages codeigniter 3 everything runs perfect in a local environment , but when I load it on a web server and have some problems :

1.- Do not remove the index.php in the URL , the problem may be caused by .htaccess code that use:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

2.- Do not locate controllers and models that are in lowercase . For example I have a controller called home.php , in the local environment but normally runs on the web server shows me the following error "No input file specified.", this is resolved by renaming the controller home.php to Home.php


Aesthetic form in the url , try removing the index.php and display controllers and models in lowercase . These are the problems I've had with this new version of CodeIgniter ( v3 ), what has changed?, how do I fix these details?

Please help me.


RE: Code to delete index.php in Codeigniter 3 and lowercase name to controllers/models - Wouter60 - 06-23-2015

This code in .htaccess works for me:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
Rename all your controllers, libraries and models so that they start with a capital letter.
Also make sure that your config.php contains this line:
PHP Code:
$config['index_page'] = ''



RE: Code to delete index.php in Codeigniter 3 and lowercase name to controllers/models - InsiteFX - 06-23-2015

Read the CodeIgniter User Guide.

Change Log


RE: Code to delete index.php in Codeigniter 3 and lowercase name to controllers/models - mwhitney - 06-26-2015

Depending on the server, you may need to change your RewriteRule to this:
Code:
RewriteRule ^(.*)$ /index.php?/$1 [L]

while leaving the rest of your .htaccess code the same.