1

I have an EC2 instance running Ubuntu 16.04. I have installed a LAMP stack and am using Codeigniter.

the removal of index.php is not working as it should. I can reach the first page but if I click on any links in the page it does not work.

I have tried to follow the directions here: CodeIgniter removing index.php from url but, It has not helped

.htaccess file: (original)

RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 

config.php:

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

header.php:

<li><a href="<?php echo base_url(); ?>">Home</a></li>
        <li><a href="<?php echo base_url(); ?>about">About</a></li>
        <li><a href="<?php echo base_url(); ?>pricing">Pricing</a></li>
ThomasC
  • 97
  • 1
  • 11
  • You've been followed answer for CI2. Read [this](https://github.com/bcit-ci/CodeIgniter/blob/develop/application/config/config.php#L4-L26) section again. – Tpojka Nov 07 '17 at 09:49

1 Answers1

1

After the LAMP install mod_rewrite did not come enabled. Found out by creating a page with php info funcion then searching for mod_rewrite. After this the .htaccess for removing index.php from the URL worked.

ThomasC
  • 97
  • 1
  • 11