0

I have tried a lot to remove index.php from the url . Its not working at all.

In config.php

$config['index_page'] = '';

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

Then put this below code in .htaccess of my project root.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]

I have tried ,its throwing page not found errors only. enter image description here

enter image description here

enter image description here Any suggestion ?? Thank you

sradha
  • 2,216
  • 1
  • 28
  • 48

4 Answers4

1

You need to change config.php and .htaccess file.

Changes in application/config/config.php

$config['index_page'] = ""; // And Remove index.php

Changes in .htaccess

RewriteEngine on

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

Make Sure

  1. Your .htaccess must under cloud directory.

  2. Rewrite module must be enabled in Apache.

Muhammad Hassaan
  • 7,296
  • 6
  • 30
  • 50
1

Your base URL is not the base domain name, so modify your .htaccess file and add the following:

RewriteBase /cloud

This should fix your issues.

James Lalor
  • 1,236
  • 9
  • 22
0

try this ,
Changes in .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Dave
  • 3,073
  • 7
  • 20
  • 33
0

Make sure your RewriteEngine is on in apache conf file if not then follow this link

How to enable mod_rewrite for Apache 2.2

Community
  • 1
  • 1
Niklesh_Chauhan
  • 647
  • 5
  • 16