CodeIgniter 3.1 not working in PHP 5.4 on Server

100 Views Asked by At

Getting 404 page not found error on Server , Whereas its working fine on local machine

Below in my .htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

Below is base_url code in config.php

$root=(isset($_SERVER['HTTPS']) ? "https://" : "http://").$_SERVER['HTTP_HOST'];
$root.= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
$config['base_url'] = $root;
1

There are 1 best solutions below

0
ThT On

base_url code / Dynamic URI shouldn't be in 'config.php' because its function to establish "base". Move it to 'index.php' of 'root' directory.