bryan404
bryan404

Reputation: 75

Codeigniter web app working on localhost but not on live server

I have a CodeIgniter project which works perfectly on my local. But when I try to put it on the live server (windows server 2008) it only loads the navbar which is included on my header.php. but the rest of the page doesn't show up.

I also check on developer tool on chrome but the XHR section under network tab is empty which is on my localhost has the list of js function that is running.

My .htaccess looks like this in case it has something to do with it.

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

Anyone who has an idea of what should be done. Thanks.

Upvotes: 2

Views: 2175

Answers (1)

Sreejith Gopinath
Sreejith Gopinath

Reputation: 98

Just tryout this solution: First change this valiables in /application/config/config.php

$config['base_url'] = 'http://example.com/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

Then change in .htaccess file

RewriteEngine on
RewriteBase /

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

Not sure whether any issue with loading in windows server as not yet tried.

Upvotes: 1

Related Questions