EllisLab text mark
Advanced Search
     
Can’t even get the installation right - (404 page not found error message)
Posted: 09 September 2007 08:15 PM
Joined: 2007-09-09
10 posts

Hi all;
I am on an 1and1 server and I have put codeigniter in the following directory of my site
www.mysite.com/codeigniter. Now this means that the path to applications directory is
www.mysite/codeigniter/system/application/.
This is content of the relevant part my config.php :

<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://www.your-site.com/
|
*/
$config['base_url']    "http://www.mysite.com/codeigniter/";

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'"index.php";

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'            Default - auto detects
| 'PATH_INFO'        Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'        Uses the REQUEST_URI
| 'ORIG_PATH_INFO'    Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol']    "AUTO";

/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://www.ellislab.com/codeigniter/user-guide/general/urls.html
*/

$config['url_suffix'"";

/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language']    "english";

/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'"UTF-8";

/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the "hooks" feature you must enable it by
| setting this variable to TRUE (boolean).  See the user guide for details.
|
*/
$config['enable_hooks'FALSE;


/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries.  For more information please see the user guide:
|
| http://www.ellislab.com/codeigniter/user-guide/general/core_classes.html
| http://www.ellislab.com/codeigniter/user-guide/general/creating_libraries.html
|
*/
$config['subclass_prefix''MY_';


/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars''a-z 0-9~%.:_-'


However when I navigate to www.mysite.com/codeigniter/  all I get is a 404 page not found error. Am I doing this right ?

 
Posted: 09 September 2007 08:37 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-23
370 posts

2 questions:
- Where do you have your index.php file?
- have you configured index.php correctly?

 Signature 

Mac OS X 10.8, Apache 2.x, NGiNX, PHP 5.4.x, CodeIgniter 1.7.2/2.1.3

 
Posted: 10 September 2007 12:36 AM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-07-30
2144 posts

He shouldn’t have to make any changes to index.php.

I would make sure index.php is in the /codeigniter/ directory like you mentioned as well as ensuring you haven’t made any changes to routes.php. The default controller listed there must exist.

 Signature 

Follow me on twitter here.
MichaelWales.com | MichaelWales.info

 
Posted: 10 September 2007 05:27 AM   [ # 3 ]   [ Rating: 0 ]
Joined: 2007-09-09
10 posts

I have not touched index.php nor any other file (except database.php). The path is www.mysite.com/codeigniter/index.php

 
Posted: 10 September 2007 06:53 AM   [ # 4 ]   [ Rating: 0 ]
Joined: 2007-09-10
4 posts

I’m having the exact same problem. Everything worked fine on my ‘localhost’ test environment, but once I moved it to my ISP’s server it stopped working. The URL www.myhost.com/myapp (or www.myhost.com/myapp/index.php ) works, but when calling a controller (e.g. www.myhost.com/myapp/index/php/registration) it gives me a 404.
What am I missing here?  (PHP version on my ISP’s servier = 4.4.4)

 
Posted: 10 September 2007 10:24 AM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2007-07-30
2144 posts

What’s your .htaccess file look like?

 Signature 

Follow me on twitter here.
MichaelWales.com | MichaelWales.info

 
Posted: 10 September 2007 10:33 AM   [ # 6 ]   [ Rating: 0 ]
Joined: 2007-09-10
4 posts

I’ve got no .htaccess (yet)...

 
Posted: 10 September 2007 12:13 PM   [ # 7 ]   [ Rating: 0 ]
Joined: 2007-09-10
15 posts

hi!
Many many many many softwares have not an intelligent wayof setting BASE-URL.

I dont know if this is your case
but I make 99% of my PHP work and applications admin from http://localhost/

now, if I set base-url in a software (sometimes even in the database!)
like this:
http://localhost/app/
then nobody else but me can use my app.

If I set base-url like this:
http://www.mydomain.com/app/
then I can not admin my apps (unless I connect via some proxy server)

This is how I have set config of my CodeIgniter ( and a whole bunch of other less intelligent softwares smile )

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
*/
$config['base_url']    "http://".$_SERVER['HTTP_HOST']."/codeigniter/"

Adding a couple of more lines, it is even possible to detect if
it should be either of:
https://
http://

This way it will work whatever URL alias is used to visit your site!
yourdomain.com, localhost, 127.0.0.1, 192.168.0.1 etc etc
And if you change your domain name, you wont have to change a thing.

Regards- phpMaster

 Signature 

... me write good php code ...

 
Posted: 10 September 2007 12:26 PM   [ # 8 ]   [ Rating: 0 ]
Joined: 2007-09-09
10 posts

Hi all;
I can’t still get the basic install working . All I get is a 404 error. I am using a 1and1 production server with PHP5. I have posted contents of my config.php above. I have not altered any other file except database.php.
Thanks

 
Posted: 10 September 2007 01:42 PM   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-23
370 posts

Have you played with the “uri_protocol” value in config.php? Some servers don’t like the default “AUTO” value.

 Signature 

Mac OS X 10.8, Apache 2.x, NGiNX, PHP 5.4.x, CodeIgniter 1.7.2/2.1.3

 
Posted: 10 September 2007 02:55 PM   [ # 10 ]   [ Rating: 0 ]
Joined: 2007-09-09
10 posts

Thanks , I actually get the welcome page now but cannot proceed beyond. On clicking user_guide I get a 403 error.

 
Posted: 11 September 2007 04:13 AM   [ # 11 ]   [ Rating: 0 ]
Joined: 2007-09-10
4 posts

I solved it!! I only had to add a questionmark to the index.php in my config.php:


/*
|—————————————————————————————————————
| Index File
|—————————————————————————————————————
|
| Typically this will be your index.php file, unless you’ve renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config[‘index_page’] = “index.php?”;

Just found it in the userguide…

 
Posted: 11 September 2007 04:39 AM   [ # 12 ]   [ Rating: 0 ]
Joined: 2007-09-11
4 posts

:’( I’m on hour 6 of trying to get this thing to work, same problem.

 
Posted: 14 August 2008 12:26 PM   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-14
1 posts

I know this is an old thread, but I had the same problem today so thought I ought to share the fix that worked for me.

I’m running CodeIgniter 1.6.3 on a linux server hosted by webfusion.

I kept hitting the 404 error until I changed the line below in the config.php file:

$config['uri_protocol']    "AUTO"

to:

$config['uri_protocol']    "QUERY_STRING"

Which fixed it for me… Jim.

I hope it helps someone else too :)

m.