该页面未在codeigniter中正确重定向

I am trying to redirect to another page if a certain condition is met. I am new to Codeigniter, yet to understand the framework.

I have an external page which check the database for a condition, after which redirect to the page involved.

Challenge:

The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

if I access

http://localhost:83/law/ in the browswer, instead of redirecting to either http://localhost:83/law/b02.php
or http://localhost:83/law/index.php it redirects to:

http://localhost:83/law/admin/b02.php

Don't know where the admin dir comes from

sys_config.php

<?php 
include ('application/config/functions.php');
require_once("application/config/cons.php");

    $host = $_SERVER['HTTP_HOST'];
     $sql ="SELECT host FROM tray WHERE host = '$host'";

       $ret = mysqli_query($mysqli,$sql);
       $row = mysqli_fetch_array($ret);


    if ($row['host'] != '' && $row['host'] == $host) {
        #$dir = base_url("index.php");
        redirect("index.php", true);
    } else {
        //echo "<p>Nothing matched your query.</p>";
        redirect("b02.php", true);

    }
 ?>

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteBase /law/
RewriteRule ^(.*)$ sys_config?/$1 [L]
</IfModule>