skip to Main Content

How to make my codigniter url seo friendly.

this is my url


i want url like this




  1. read this article

    to create url like this :
    add this code in routes.php

    $route['article/(:any)'] = "article/readmore/$1";

    description :

    1. article : class name
    2. readmore : method from class article
    3. $1 : get value from uri segment 2 value
    Login or Signup to reply.
  2. Actually you have two options

    1) Using Routes (this one already denyptw discussed right ?)

    2) use the URL Helper url_title function

    Note : You can use Parameter instead of query string



    web controller , search function , doctor parameter

    example :

    class Web extends CI_Controller
    public function search($value)
      //use this $value in your searching logic 

    You need Example of URL Helper

    check this link Codeigniter URL: How to display id and article title in the URL

    Login or Signup to reply.
    1. you can do this using routes.(Elislab)
    2. as a simple trick.(Using Controllers)

      • each and every page create a controller. (ex: if contact create contact controller, if product create product controller.) So each and every link will be look like(if you click product),(if you click contact)

      • If you want something to do with your product then write that method inside the product controller.(ex if you create cart then URL show )

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top