I’ve got a small problem while installing codeigniter on a sub-folder within my project. The problem is that I’am not able to remove the index.php from the url. I’ve got an .htaccess file which was working absolutely fine until I installed it inside a sub-folder. The folder structure is as given below:
test_project/myapp
myapp – codeigniter installation folder.
CodeIgniter Config:
base url : “http://localhost/test_project/myapp/”
My .htaccess file contains the following:
RewriteEngine On
RewriteBase /myapp
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
The above .htaccess file works perfectly if I shift my codeigniter installation to the test_project.I’ve placed the .htaccess within my sub-folder(myapp) where the index.php resides.
I have installed this on a WAMP server and am using codeigniter 2.1.2
Thanks
Remove or comment these lines:
The reasoning is that the proceeding 3 lines in your .htaccess are relative and should work no matter what directory you decide to put your application in.