skip to Main Content

i’ve got a project in codeigniter and i want to modify its url link.

The current link is: http://fortin.agency/audit-seo/frtcrwl/647/bikearena.ro?/health_check/report/647/bikearena.ro

And i want to remove “health_check/raport/” while the page is still working.

So the new url must look like: http://fortin.agency/audit-seo/frtcrwl/647/bikearena.ro

I used some htaccess code for redirect and rewrite url but it doesnt work. So the current htaccess file is:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [PT,L]

Please, dont bother with htaccess, its only a rule to remove index.php and any other rules wont work.

I just need to know from controllers how to do that.

Is it possible?

EDIT for PACIO

this is located in health_check.php

class health_check extends Home
{

    public function __construct()
    {
        parent::__construct();
    }

    public function index($base_site="")
    {
      $this->raport();
    }

    public function raport($id=0,$domain="")
    {

2

Answers


  1. Make use of routes for this. Something like this:

    $route['(:num)'] = 'health_check/raport/$1';
    
    Login or Signup to reply.
  2. You can define routes for controller url permalink

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