0

I have a website developed in PHP using Codeigniter framework.

I have included .htaccess file in it and it works fine for all my web pages and I don't get index.php, but when I type my admin url which is

mywebsite.com/admin

it goes to

www.mywebsite.com/index.php/admin.

The index.php only appears when I try to go to my admin page.

I tried a lot to get rid of it, I even included a copy of .htaccess file both in the admin controller and view folders as well but nothing works. Any suggestion is welcome.

Pradeep
  • 9,667
  • 13
  • 27
  • 34
Shantanu
  • 148
  • 3
  • 12

2 Answers2

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

Make sure it should be on root folder and set your base_url in the config.php. e.g $config['base_url'] = 'localhost/home'

0

add following changes,

application/config/config.php

$config['index_page']   = '';
$config['uri_protocol'] = 'REQUEST_URI';

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>
Anfath Hifans
  • 1,588
  • 1
  • 11
  • 20