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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:24:05+00:00 2026-06-07T21:24:05+00:00

Question: How do I move from an old url to a seo friendly url

  • 0

Question: How do I move from an old url to a seo friendly url in codeigniter?

Example:
I have a codeigniter controller called library.
The URL looks like http://www.domain.com/library

This is not seo friendly and I want it to look like http://www.domain.com/keyword-library
How do I fix this? .htaccess and routing isn’t enough because I need the old pages to redirect to the new url with 301 so searchengines pick this up.

  • 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-07T21:24:07+00:00Added an answer on June 7, 2026 at 9:24 pm

    I use the application/config/routes.php to reroute new url queries to the old controller object

    $route['keyword-library/(:any)/(:any)/(:any)/(:any)/(:any)'] = "library/$1/$2/$3/$4/$5"; 
    $route['keyword-library/(:any)/(:any)/(:any)/(:any)'] = "library/$1/$2/$3/$4"; 
    $route['keyword-library/(:any)/(:any)/(:any)'] = "library/$1/$2/$3"; 
    $route['keyword-library/(:any)/(:any)'] = "library/$1/$2"; 
    $route['keyword-library/(:any)'] = "library/$1"; 
    $route['keyword-library'] = "library"; 
    

    Then in the /index.php file before any other code executes I add this to reroute old pages to new pages.

    $uri = $_SERVER['REQUEST_URI'];
    if(strpos($uri,'/library') === 0)
        {
        $expl = explode('/library',$uri);   
        //array_shift($expl);
        $query = implode('',$expl);
        $redirect= "https://".$_SERVER['HTTP_HOST'].'/orthomoleculaire-bibliotheek'.$query;
        header( "Status: 301 Moved Permanently" );
        header("Location: $redirect");
        exit(0);
        }
    

    I have tried using .htaccess for this, but for some reason I didn’t manage to make this work to reroute old urls to new urls with 301 because of the changing variables and variable lengths.

    If anyone knows a more elegant solution, please post it, because I haven’t been able to find one.

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

Sidebar

Related Questions

Simple SQL syntax question. I'm writing a script to move data from an old
This is linked to my other question when to move from a spreadsheet to
I have found this question; Can I move a Flash object within the DOM
I'm trying to move a project from an old linux platform to a kubunutu
I have an old databasefile from an application written in Delphi. My task is
We have an ages old Java applet that we want to move forward to
I'm actually just copying an old question from railsforum as he asked it back
A script I wrote was meant to move individual day directories from an old
My question is : how to move beyond writing a custom implementation of a
Very noob question, I know, but I didn't manage to handle real-time slider move

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.