简体   繁体   English

带有HMVC的Codeigniter 3.x-仅需小写URL

[英]Codeigniter 3.x with HMVC - Need URLs in lowercase only

I have a linux server, as per CI 3 docs, all my class files are ucfirst ie Home.php having class Home etc. 我有一个Linux服务器,根据CI 3文档,我所有的类文件都是ucfirst,即具有类Home等的Home.php。

What I need is that I should be able to call the url like this http://server/home . 我需要的是我应该能够像这样http:// server / home那样调用URL。 As of now it doesn't allow this type of URL because linux is case-sensitive and it can't find home.php . 到目前为止,由于Linux区分大小写并且找不到home.php,因此它不允许这种类型的URL。

But, when I try http://server/Home it works. 但是,当我尝试使用http:// server / Home时,它可以工作。 Can anyone help me to get all my URLs to work in lowercase irrespective of what convention is used for file naming. 任何人都可以帮助我,使我的所有URL都使用小写字母,而不管文件命名使用什么约定。

Please note I am using HMVC for application. 请注意,我正在使用HMVC进行应用。

Yep, Linux is case sensitive... I've just had a play with this and it seems that you may have the following folder structure... 是的,Linux区分大小写...我刚刚玩过这个游戏,看来您可能具有以下文件夹结构...

application
   modules
      Home <<==== this should be home ( all lower case )
        controllers
           Home.php

If you call your Module folder name Home you will need to call it Home in the url... 如果将模块文件夹名称命名为Home,则需要在URL中将其命名为Home。

If you rename your module folder from Home to home ( all lowercase ) it will work. 如果您将模块文件夹从“ Home”重命名为“ home” (全部为小写),它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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