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

  • Home
  • SEARCH
  • 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 6162491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:39:48+00:00 2026-05-23T21:39:48+00:00

I have a code igniter project, I have used Mod_rewrite to remove the index.php

  • 0

I have a code igniter project, I have used Mod_rewrite to remove the “index.php” from url’s using this method. This works fine.

But now, I would like to remove my main controller (ie, default_controller) in config/routes.php which is named “Home”.

So Basically, my current url is:

http://localhost:85/project/Home/portfolio
http://localhost:85/project/Home/about_me

I want it to be:

http://localhost:85/project/portfolio      // Get rid of the "Home"
http://localhost:85/project/about_me       // Get rid of the "Home"

And if I use another controller apart from “Home” (My main controller), I want it to be displayed in the URL as normal.

So if I create a controller named “Blog”, I want to be able to use “Blog” in the URL, so I dont want to get rid of this, because its not the default_controller.

So I should be able to access Blog methods as usual like so:

// Here I want to see the Blog Controller -> Then -> Method Name as usual.
http://localhost:85/project/Blog/entry/1
http://localhost:85/project/Blog/create
http://localhost:85/project/Blog/delete

I’m not good at all with mod_rewrite so any sort of simple explanation would suffice.


[EDIT]
Can anyone tell me if this is even possible?
What else can I name my controller to look good in a browser rather then “Home”?

  • 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-05-23T21:39:50+00:00Added an answer on May 23, 2026 at 9:39 pm

    Of course just because you’ve named the controller “Home” doesn’t make it any different from another controller. There is not so much a default controller as there is a default page (if no URL segments are present), which is defined in your routes.php. You can also use routes to map requests within CI instead of .htaccess (exactly what they’re for):

    $route['portfolio'] = 'home/portfolio';
    $route['about_me'] = 'home/about_me';
    
    // Alternative
    $route['(portfolio|about_me)'] = 'home/$1';
    

    This basically says: “If the user requests $key, give them $value”. Routes are awesome, definitely worth learning how to use to your advantage.

    Read more: http://codeigniter.com/user_guide/general/routing.html

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

Sidebar

Related Questions

In Kohana/CodeIgniter, I can have a URL in this form: http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ... And then
I have used PHP for awhile now and have used it well with CodeIgniter,
I have code similar to this filtering entries in an Array of Objects: var
I have code like this: var newMsg = new Msg { Var1 = var1,
I have code like this: template <typename T, typename U> struct MyStruct { T
I have code like this to move the player in my game left, right,
I have code that looks like the following, which works fine for displaying the
I am using PHP and the codeigniter framework for a project I am working
I have one project that is using ESAPI4PHP which is a port of OWASP's
I started using codeigniter for my project. I have user authentication system for my

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.