codeigniter site inner links showing 403 forbidden access

The site was showing some error and I downgraded the PHP from 5.6 to 5.4. But only home page was loading.

Added the following code in the .htaccess file to correct the issue.

IfModule mod_rewrite.c
RewriteEngine On
#RewriteBase /your_project/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
IfModule

IfModule !mod_rewrite.c
ErrorDocument 404 /index.php
IfModule

After that inner links also started loading fine.

Leave a comment