Welcome Guest, Not a member yet? Register   Sign In
Problem displaying index.php and default controller!
#1

[eluser]Unknown[/eluser]
Hi there,

I'm having a problem in that when I go view the codeigniter folder of my site, instead of running the default controller, I get a 404 error.

For example, if I go to www.mysite.com/ci/

It just spits out a 404.

Same if I go to www.mysite.com/ci/index.php

However, if I go to something like

www.mysite.com/ci/A_Controller

The controller runs as it should.

I'll post the relevant text from routes.php and config.php

Routes.php
Code:
$route['default_controller'] = 'Home';
$route['page/([0-9]+)'] = "Home/page/$1";
$route['Logout']  = "Login/do_logout";
$route['404_override'] = '';

Config.php
Code:
$config['base_url'] = 'http://jrdnhannah.co.uk/ci/';

$config['index_page'] = '';

I have a .htaccess file in the /ci/ folder, but editing it or just deleting it doesn't seem to have much of an effect, other than deleting it means I have to run a controller with index.php in front of it, ie index.php/My_Controller.
I'll post what I have in it, taken from http://codeigniter.com/wiki/mod_rewrite/

Code:
<IfModule mod_rewrite.c>

RewriteEngine on

RewriteBase /jh/ci/

# Removes access to the system folder by users.
    # Additionally this will allow you to create a System.php controller,
    # previously this would not have been possible.
    # 'system' can be replaced if you have renamed your system folder.

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

# When your application folder isn't in the system folder
    # This snippet prevents user access to the application folder

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php



RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

If I need to post any more information, I'll be glad to.
Thanks for your time Smile




Theme © iAndrew 2016 - Forum software by © MyBB