codeigniter子文件夹中多个控制器多个、控制器、文件、夹中

2023-09-02 09:59:37 作者:中二病

下面是我的htaccess的文件,它的工作原理有点。没有关系我指定哪些控制器,它总是转到主页

Here is my htaccess file and it works somewhat. Not matter what controller I specify it always goes to the home page

<IfModule mod_rewrite.c>
RewriteEngine On

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index.php|css|js)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

这是我的网站的网址

http://automationmetrics.local/automation/

思考?

推荐答案

前两个规则被触发上的所有文件,就像它说在注释中。所以这一个:

The first two rules get triggered on all the files, just like it says in the comment. So this one:

RewriteCond $1 !^(index.php|css|js)

似乎是多余的,并删除它应该解决您遇到的问题。

seems redundant and removing it should solve the issue you're having.

 
精彩推荐
图片推荐