[NEED URGENT HELP] All controllers showing 404 except default controller |
(05-16-2015, 05:37 AM)karthik_code Wrote: Can you able to access directly? No. I can only asscess- example.com example.com/faculty-member example.com/registration where faculty-member & registration are methods of my default controller. But I cannot access example.com/student or example.com/student/profile Where student is another controller. (05-16-2015, 05:42 AM)Muzikant Wrote: Just blind guess - Try to add "RewriteBase /" to your .htaccess file: Nothing Code: RewriteEngine On
Another blind guess - When you created new controller, you probably make it by copying content from your main controller. Did you rename controller class as well?
For example in your Student.php file could be the wrong class name: PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); "class Home extends CI_Controller {" (05-16-2015, 06:02 AM)Muzikant Wrote: Another blind guess - When you created new controller, you probably make it by copying content from your main controller. Did you rename controller class as well? Please take a look at my main post. As I said before- Quote:It is working without any error on my localhostso there is no chance for this type of error.
From your initial statement : You have stated that the application works perfectly in your developer machine (might be Windows) and not working on live server (might be Linux).
I guess there should be a server side configuration issue. 1. If you are using Windows machine for development, case sensitivity issue may come for File names, class names for the same code in Unix/Linux server. 2. If you can access the methods directly by including 'index.php', there may be an issue with Apache configuration - Directive 'Allow Override All' may be missing in apache conf file. Other troubleshooting tips: 1. Remove .htaccess and try to access the controllers and methods directly without the help of mod_rewrite. 2. Remove & Add the rules one by one in routes, it may help you to detect the controller or rule which causes the issue.
Try this htaccess
Code: RewriteEngine On When you say it works on localhost but not on server...and "so there is no chance for this type of error."... That is absolutely not true unless your server has the exact same OS, webserver, modules, php version, php modules, setup, etc as your development server which most likely isn't the case unless you're using a virtual machine or something. Some OS's are case sensitive when it comes to filenames and others aren't.
I think the problem is the new naming convention which enforces UCfirst Controller Filenames (and Classnames!). This error will not occur on windows machines where there's no difference in (un)capitalized filenames. So if your controller is named student.php rename it to Student.php. Same convention for libraries i believe.
Excuse my poor english - non native speaker... Cheers Thorsten (05-16-2015, 02:16 AM)webdevron Wrote: try using index.php before adding your controller's nameMy .htaccess code is here Code: RewriteEngine On |
Welcome Guest, Not a member yet? Register Sign In |