I am trying to remove index.php
in codeigniter.my codegiter project is inside public_html/programemis/lasoona/
.I have my .htacess
file with the following code.
RewriteEngine on
RewriteBase /lasoona/
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
but its not working .any one please help.
Try this :
RewriteEngine on
RewriteBase /programemis/lasoona/
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /programemis/lasoona/index.php?/$1 [L,QSA]
There have been a lot of solutions posted online for this. Here's from stackoverflow itself:
Codeigniter remove index.php - htaccess localhost
If it won't work, here's another (this works for me) based from:
https://docs.expressionengine.com/latest/urls/remove_index.php.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
</IfModule>
Just be mindful of the location of .htaccess .
I use it and working try it. If dont work remove programemis folder from RewriteBase. If you get same problem I recommented create a sub-domain.
RewriteEngine on
RewriteBase /programemis/lasoona/
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.