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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:02:36+00:00 2026-06-05T11:02:36+00:00

I have searched for the solution to my problem in CI user guide and

  • 0

I have searched for the solution to my problem in CI user guide and on Stackoverflow as well but couldn’t find. So, here is my problem.

I need to build SEO friendly URLs. I have a controller called “Outlets” and the view that I need to generate will have a URL structure like http://www.mysite.com/%5Bcity%5D/%5Barea%5D/%5Boutlet-name%5D.

The segments city and area are fields in their respective tables and outlet_name is a field in the table “Outlets”.

I am able to generate a URL like http://www.mysite.com/outlets/123 but how do I add the city and area name to the URL.

  • 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-05T11:02:40+00:00Added an answer on June 5, 2026 at 11:02 am

    If all of your page use the same controller, in config/routes.php add this…

    $route['(:any)/(:any)/(:any)'] = "outlets/$1/$2/$3";
    $route['(:any)/(:any)/(:any)/(:any)'] = "outlets/$1/$2/$3/$4"; // fixed typo
    

    In the controller you will want to remap the function calls because Codeigniter will be looking for functions with the names of the city and they will not exist.

    http://codeigniter.com/user_guide/general/controllers.html#remapping

    public function _remap($city, $area, $outlet, $options = '')
    {
      $this->some_function_below($city, $area, $outlet, $options);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched the web but I cannot find the solution to my problem.
I've searched in other posts but I couldn't find a solution. I have a
I have searched S/O, but unable to find a solution that helps my problem.
I searched this problem in the site, but I couldn't find a solution. I
I have searched far and wide here but with no solution to my problem
I've searched google and SO for a solution to this problem but have not
I have searched online for a solution, but have yet to find one that
I have searched around Google and StackOverflow trying to find a solution to this,
I searched everywhere but didn't find the solution. I have image 1. How can
i really need some help on this. I searched the internet but couldn't find

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.