Welcome Guest, Not a member yet? Register   Sign In
went live - links not working anymore - please help

here is my routes file. I have deleted the .htaccess file and set it to work with index.php in the url. This is still working fine on my localhost, but i'm getting the same error on the live version - page not found.

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
| -------------------------------------------------------------------------
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
| example.com/class/method/id/
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
| Please see the user guide for complete details:
| http://ellislab.com/codeigniter/user-gui...uting.html
| -------------------------------------------------------------------------
| -------------------------------------------------------------------------
| There are two reserved routes:
| $route['default_controller'] = 'welcome';
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
| $route['scaffolding_trigger'] = 'scaffolding';
| This route lets you set a "secret" word that will trigger the
| scaffolding feature for added security. Note: Scaffolding must be
| enabled in the controller in which you intend to use it. The reserved
| routes must come before any wildcard or regular expression routes.

$route['default_controller'] = "home";
$route['scaffolding_trigger'] = "";

/* End of file routes.php */
/* Location: ./system/application/config/routes.php */

just out of curiousity, are you links setup to same capitalization as your classes? I ran into an issue where domain.tld/Help did not work, but domain.tld/help did.

i've tried both, unfortunately to no avail

tried deleting the install from the server and installed just a basic codeigniter site with two pages, welcome and test, using two controllers to see if it would work.

I'm still getting the same error (though i can get it to work on the localhost), so it must be a server issue any idea what setting or permission could cause this?

You are definitely doing the right thing by clearing the server and trying to get an unmodified CI install working. It is actually pretty unusual to have such issues with a basic CI install as they usually work out of the box. So it is definitely a server issue of some sort.

First, we'll assume a default install with only the url modified. Skip any special config alterations and just pop in the web address as indicated in the file.

Now you should try: website.com/ - should be your welcome to ci page
website.com/index.php - should be the same
website.com/index.php/welcome/index - again, the same
website.com/index.php/welcome - again, the same.

Then try making a new controller by copying the welcome controller and changing the names as appropriate, leaving index() and just changing the name of the constructor and class name.

so you should have test.php in the controllers folder, class Test extends Controller, with a function Test() constructor, and a function index() for the default page.

then try
website.com/index.php - should be welcome
website.com/index.php/test/index - should work
website.com/index.php/test - again, should work.

Try again with and without trailing slashes, and report back what happens. That should narrow down where the problem could be.
Then, in every case go back in and add a trailing / and make sure everything still works.

i'm still at the basic control - tried a few older versions of codeigniter, all the way back to 1.5, with no results so I am back up to using 1.7.2.

with this set up I am able to successfully browse to:

that's it, i got a 404 error for eveything else

not sure if it helps, but if i try browsing to


i get the following error

Fatal error: Class welcome: Cannot inherit from undefined class controller in /var/www/canada/eglisedieuvivant.org/application/controllers/welcome.php on line 3

Believe it or not, that's good!

The problem is Apache's handling of url rewriting. Your server is receiving the request for index.php/ and going "Huh, there is no index.php directory - return 404".

By the way, you are getting the standard 404 message - not the codeigniter 404 message, right?

Assuming you aren't getting the CI's version of 404 which is so different than the 404 you would have seen anywhere before, you can now be pretty sure of the problem. It's url translating.

To further make absolutely certain that this is the case before you go on a wild goose chase, open your config.php and go to $config['enable_query_strings'] and set it to TRUE.

Now try this: mywebsite.com/index.php?c=welcome&m=index

If that works, try: mywebsite.com/index.php?c=test&m=index

If that works as I think it will, then your problem is definately an Apache/htaccess one. First, you'll need to make sure your host server is configured to allow mod_rewrite and permits you to use htaccess files in your directories. Then you'll need to test various examples of htaccess and see if you can get anything working, with or without index.php.

Once you have the right settings everything should work as intended and you will, hopefully, be good to go.

[quote author="heymike" date="1260573523"]not sure if it helps, but if i try browsing to


i get the following error

Fatal error: Class welcome: Cannot inherit from undefined class controller in /var/www/canada/eglisedieuvivant.org/application/controllers/welcome.php on line 3[/quote]

That'll be a false lead - you get that because index.php has to run first to load CI, which in turn will load the controller class before welcome.php ever gets called.

the enable query string adjustment worked.

Just waiting to hear back from the server admin to find out what the mod_rewrite settings are.

Thank you very much!

Theme © iAndrew 2016 - Forum software by © MyBB