Could you point whyat's needed to a Codeigniter app to correctly be started?

Eduardo Fuerte
Eduardo Fuerte used Ask the Experts™
on
Hi Experts

Could you point whyat's needed to a Codeigniter app to correctly be started?

When opened the app presents this screen

img006
And index.php must be fired to make it start.


Another app under the same htdocs present  the login screen but only correctly runs if index.php is used in the path.

Thanks in advance!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ayoub RouziEntrepreneur & Web developer

Commented:
You need to setup CI to point to the right base URL of the app. To do this, open up system/application/config/config.php and
edit the base_url array item to point to your server and CI folder.

$config['base_url'] = "http://localhost/ci/";

We'll do a quick test to see if CI is up and running properly. Go to http://localhost/ci/ and you
should see the following.
test.jpg
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Hi

It had been configurated before like:

$config['base_url']	= 'http://xx.xxx.x.xxx/app/';

// xx.xxx.x.xxx = IP

Open in new window

Ayoub RouziEntrepreneur & Web developer

Commented:
change it to:

$config['base_url']	= 'http://localhost/app/';

Open in new window


Where "app" is the name of your application folder.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Eduardo FuerteDeveloper and Analyst

Author

Commented:
Nothing changes.
Ayoub RouziEntrepreneur & Web developer

Commented:
Did you ever checked with another codeigniter version ?
Eduardo FuerteDeveloper and Analyst

Author

Commented:
It must to perform on this CI  version.
Freelancer
Top Expert 2010
Commented:
Hi Eduardo.
First, let me say your directory tree looks unusual: I don't see the standard CodeIgniter directories application and system. index.php should reside in the same directory of those standard directories:
.git
.gitignore
application
dump
system
index.php

Open in new window

Second, you should have a .htaccess file in your application root: if you have, please post it here; otherwise create one and put this as first line (read more at http://www.htaccess-guide.com/directoryindex-uses/):
DirectoryIndex index.php

Open in new window



Third, as Ayoub Rouzi said, you must configure properly the value of $config['base_url'] to make CI application internal links work correctly.
http://xx.xxx.x.xxx is just a placeholder. If you are on your local server this value should be set to 'http://localhost/<your_application_directory>; if your application is hosted in a server, you should set the value to your domain name + eventual subdirectory

Fourth, you can remove index.php using a .htaccess file like this one (read about this here: https://www.codeigniter.com/userguide3/general/urls.html; if you are using a previous major version of CI you can read this: http://kylenoland.com/codeigniter-2-htaccess-file/)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Open in new window

In addition you have to set $config['index_page'] in application/config/config.php to an empty value:
$config['index_page'] = '';

Open in new window

Eduardo FuerteDeveloper and Analyst

Author

Commented:
Hi Marco!

Sorry the delay, I get an intercorrence...

I'm returning to this question asap.
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Oh... the server where I get to test abends - the suport crew is checking what's wrong.
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Thanks for help!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial