Welcome Guest, Not a member yet? Register   Sign In
Can't even get the installation right - (404 page not found error message)
#1

[eluser]bingecoder[/eluser]
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 :

Code:
<?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 ?
#2

[eluser]coolfactor[/eluser]
2 questions:
- Where do you have your index.php file?
- have you configured index.php correctly?
#3

[eluser]Michael Wales[/eluser]
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.
#4

[eluser]bingecoder[/eluser]
I have not touched index.php nor any other file (except database.php). The path is www.mysite.com/codeigniter/index.php
#5

[eluser]MadA[/eluser]
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)
#6

[eluser]Michael Wales[/eluser]
What's your .htaccess file look like?
#7

[eluser]MadA[/eluser]
I've got no .htaccess (yet)...
#8

[eluser]phpMaster[/eluser]
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 )
Code:
/*
|--------------------------------------------------------------------------
| 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
#9

[eluser]bingecoder[/eluser]
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
#10

[eluser]coolfactor[/eluser]
Have you played with the "uri_protocol" value in config.php? Some servers don't like the default "AUTO" value.




Theme © iAndrew 2016 - Forum software by © MyBB