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 8927959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:19:35+00:00 2026-06-15T08:19:35+00:00

Forgive me if this is a duh question or if you need more information

  • 0

Forgive me if this is a “duh” question or if you need more information to answer, I am new to CodeIgniter and still haven’t figured out a few things with best practices and such…

In routes.php I have $route['default_controller'] = "home"; so my default_controller is obviously “home”.

Inside my home.php controller I have:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {
    function __construct() {
        // blah
    }
    function index(){
        // blah
    }
    function login(){
        // blah
    }
}

Which works fine and everything, there is no problems with that. The only thing I can’t figure out is if I want to access the login function, I currently have to go to http://www.blah.com/home/login. How can I change it so it just goes to http://www.blah.com/login, without creating a new controller (I would like to keep some of these one time base urls all in my default controller)? Is that even possible or do I just have to create a new controller?

If I just have to create a new one, is there a best practices for how many controllers you have, etc.

  • 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-15T08:19:36+00:00Added an answer on June 15, 2026 at 8:19 am

    Documentation says: This route will tell the Router what URI segments to use if those provided in the URL cannot be matched to a valid route.

    So use $route['login'] = 'home/login';

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

Sidebar

Related Questions

Please forgive this rather basic question, but I'm very new to Java and still
I'm kinda new to rails so forgive if this is a stupid question. The
I'm new to JPA, so forgive this question if this is pretty standard functionality,
Forgive me if this is a stupid question. I'm a bit new to mobile
I am new to PHP so please forgive if this question or problem seem
I'm new to C#, so forgive this noobish question. I'm playing with a simple
I'm just starting out, so please forgive if this is a silly question. I'm
Forgive me if this is a stupid question. I am completely new to building
Forgive me if this is in the wrong place, but I figured a few
I'm new to js/jQuery. Forgive this horrible script. I'm lost. *(Updated with global variable

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.