简体   繁体   中英

Codeigniter routes.php Controllers are not working with lowercase

I redirected my controllers to lowercase in .htaccess , but after redirecting to lowercase I am getting error as shown below.

在此输入图像描述

My Controllers file name is: Seo_Services.php

My routes.php file declaration is:

    $route['seo-services'] = 'Seo_Services';

Note: This works on localhost. Not working on Godaddy hosting panel.

Please Help!

Edited: Note: To make it more clear, I just want my url to be lowercase.

Working: https://immacbytes.com/Seo-Services

Not Working: https://immacbytes.com/seo-services

Codeigniter Controller Example and naming conventions

<?php
class Blog extends CI_Controller {

        public function index()
        {
                echo 'Hello World!';
        }
}

The file must be called 'Blog.php', with a capital 'B'.

Class names must start with an uppercase letter.

This is valid:

<?php
class Blog extends CI_Controller {

}

This is not valid:

<?php
class blog extends CI_Controller {

}

Please check and revert.

I just knew that my web.config is wrong. I was passing a rule to redirect Seo-Services to seo-services. Rule is shown below:

<rule name="bfgfgg-fgfg-g-ff" stopProcessing="true">
    <match url="Seo-Services" />
    <action type="Redirect" url="seo-services" />
</rule>

May be the web.config rule are not case sensitive . So this rule was getting triggered again & again. In result I was getting error.

Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM