Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8777699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:20:24+00:00 2026-06-13T19:20:24+00:00

Now, when CodeIgniter does not find a controller for a route or a route

  • 0

Now, when CodeIgniter does not find a controller for a route or a route for the uri, it shows a generic 404 page. How can I show the accessed route or controller or something useful that would allow me to debug why it’s showed a 404?

Code:

switch ($_SERVER['HTTP_HOST']) {
    case 'multiplelines.domain.ro': 
             $route['default_controller'] = "subdomain"; break;
    default: $route['default_controller'] = "welcome"; break;
}


$route['scaffolding_trigger'] = "";
$route['404_override'] = '';
if($_SERVER['HTTP_HOST'] == "www.domain.ro" 
   || $_SERVER['HTTP_HOST'] == "domain.ro")
{
  // URI like '/en/about' -> use controller 'about'
  $route['^(romana|english|magyar)/(.+)$'] = "$2";

  // '/en', '/de', '/fr' and '/nl' URIs -> use default controller
  $route['^(romana|english|magyar)$'] = $route['default_controller'];
}
else
{

}

Desired effect:
When on www or empty subdomain routing will occur like this:
/language/test will go to test controller

When on another subdomain (I just listed one case) will be routing to the subdomain controller as I just want to use one controller for those.

Note: Now when on www or empty subdomain there is code to choose the language automatically for /test route for test controller (without language directory in uri).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:20:25+00:00Added an answer on June 13, 2026 at 7:20 pm

    When CI dont find correct Route for a page it knows that there isn’t such page so it is giving 404 NOT EXISTING..

    If user try to open /sgasgasggsasga page at your site it gets 404 for the same reason..

    You have to find by yourself why its showing 404…

    Look at http://codeigniter.com/user_guide/general/routing.html for help 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem right now with CodeIgniter : I use the REST Controller
I try to write a Jquery. Ajax in codeigniter. But it does not post
I've used Codeigniter 1.7 before and now I've upgraded to Codeigniter 2. I'm trying
I have been using the CodeIgniter system for a while now - but it
I came from PHP language(codeigniter), but now I learning ASP.Net MVC :) In PHP
I have a copy of codeigniter running. And I am now also attempting to
I have some questions concering routing with Codeigniter. What I´m doing now is the
I'm creating my own script using the CodeIgniter MVC framework. Now, i want users
Now I'm not sure if this is something I'm doing wrong, or something thats
I got a working webpage with CodeIgniter. I did now just upload it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.