0

I am unable to remove index.php from my project Url. Below is the code i had try for that.

Below same code and config setting working properly for my another project hosted on same server

In .htaccess file

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|imgs)
RewriteRule ^(.*)$ index.php/$1 [L]  
RewriteRule ^media/images/([0-9]+)/([A-Za-z0-9-]+).jpg?$ imgs/$1  [T=image/jpeg,L]
<Files "index.php">
AcceptPathInfo On
</Files>

.htaccess file is placed parallel to application folder and under root folder.

In config.php file

$config['uri_protocol'] = 'PATH_INFO';
(also tried same for all server global mentioned in config.php)

and

$config['index_page'] = '';

current project url is like http://Hostname/ODP/ (this one not working for above code)

previous project url is http://Hostname/WCP/ (this one working for above code)

Explorer
  • 177
  • 6
  • 17

1 Answers1

0
Use following htaccess code to remove index.php from your codeigniter url
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ ./index.php/$1 [L]