0

i really need help, same as the title, my problem is can't remove index.php in my codeigniter

i had try many .htaccess code like :

// first 
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /projectFolderName/ --> i already change to my project name

 RewriteCond %{REQUEST_URI} ^system.*
 RewriteRule ^(.*)$ /index.php?/$1 [L]

 RewriteCond %{REQUEST_URI} ^application.*
 RewriteRule ^(.*)$ /index.php?/$1 [L]

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

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

//third
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ – [NC,L]
RewriteRule ^(.*)$ index.php/$1 [NC,L]

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

i had change my config like

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

in some reference in my httd.conf

<Directory />
    AllowOverride All
    Require all denied
</Directory>

i move the .htaccess to main project folder (not in application) but all doesn't work

Nur Diarto
  • 55
  • 2
  • 10
  • Did you place the htacces out side of application folder not inside. –  Jan 29 '17 at 01:54
  • thank for your answer, yes i did i try both of them but not the same time, place inside --> reload the page, and place outside --> reload the page again, but its not work before now this problem is solved, i think the problem is in the browser cache – Nur Diarto Jan 29 '17 at 04:17

2 Answers2

0

You forget to set base_url in application/config/config.php.Set your base_url.

$config['base_url'] = 'your_url';

In root folder .htaccess

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

And also

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

Working fine here..

Hikmat Sijapati
  • 6,869
  • 1
  • 9
  • 19
0

That funny, my url: http://localhost/Igniter in my config: $config['base_url'] = 'http://localhost/igniter'; you can be the same me, check url with link "igniter" replace "Igniter'

son tran
  • 1
  • 1