404 error from codeigniter when hosted to server (tried every possible conditions) |
(05-31-2019, 09:45 PM)Paradinight Wrote:may be first two are not the reasons because even when i try to display a static page then also im getting 404 error from codeigniter(05-31-2019, 05:39 AM)chinna Wrote:(05-31-2019, 04:57 AM)dave friend Wrote: Are you trying to use any special routes? third one i upgraded the php to 7.3 still im getting same 404 error
Can you please write your problem/details/folder structures etc. step by step. So that we can figure it out correctly instead of hitting our head against a brick wall.
For example You mentioned that : "i checked capital letter at starting." in your first post. Did you check the First letters of Model names and Controller names in your related directories? Or your index function starts with an if(isset()).. What about the else part of the block? By the way, before everything, can you please try any, simple, "hello world" text to test the welcome page? Regards. (06-01-2019, 02:07 AM)demyr Wrote: Can you please write your problem/details/folder structures etc. step by step. So that we can figure it out correctly instead of hitting our head against a brick wall. bro, this is my code https://github.com/xXCHINNAXx/SimpleLoginCodeigniter I also tried with static pages my base controller is Welcome.php in that i have two functions 1. index 2.login index is working fine and it is loading my static html page but login is showing 404 error which is not loading my html page.
Well, If I'm not wrong in "login part" of your controllerWelcome.php you have got 3 openings of curly brackets, but 4 for closing. (starting line 21 and closing 42).
And also in your route file which is under config, please point to your login part of your controller : $route['loginn'] = 'welcome/login'; And add this line under $router['default_controller] = 'welcome'; which is main route there now. Regards. (06-01-2019, 08:43 AM)demyr Wrote: Well, If I'm not wrong in "login part" of your controllerWelcome.php you have got 3 openings of curly brackets, but 4 for closing. (starting line 21 and closing 42). bro, please solve the same problem for below code Welcome.php PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Why you need a page ending with .htm on Codeigniter? You are working on Php
PHP Code: public function index() then in the route please try: $route['the-url-on-the-browser(name-of-the-file-in-your-view)'] = 'welcome/-the-name-of-the-controller'; (06-01-2019, 12:45 PM)demyr Wrote: Why you need a page ending with .htm on Codeigniter? You are working on Phpworked bro thanks
problem solved
that was routing problem. Thanks to all who spent their time helping me (06-01-2019, 08:19 PM)chinna Wrote:(06-01-2019, 12:45 PM)demyr Wrote: Why you need a page ending with .htm on Codeigniter? You are working on Phpworked bro thanks bro getting another error my url is https://www.everstore.com.au/testcod/test/index.php/loginn it is redirecting to https://www.everstore.com.au/testcod/test/index.php/welcome/loginn ($route['loginn']='welcome/loginn'; i used this in routes.php) and showing error The page isn’t redirecting properly An error occurred during a connection to www.everstore.com.au. This problem can sometimes be caused by disabling or refusing to accept cookies.
It's redirecting right, look at your route.
controller/method welcome /loginn What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |