我正在设置我的第一个个人 codeigniter 项目,我的 .htaccess 文件是这样的:
<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On
# If your website begins from a folder e.g localhost/my_project then
# you have to change it to: RewriteBase /my_project/
# If your site begins from the root e.g. example.local/ then
# let it as it is
RewriteBase /madrigal/
# Protect application and system files from being viewed when the index.php is missing
RewriteCond $1 ^(application|system|private|logs)
# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
# Allow these directories and files to be displayed directly:
RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|public|assets|css|js|images)
# No rewriting
RewriteRule ^(.*)$ - [PT,L]
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
</IfModule>
我已将 config.php 文件设置为 $config['index_page'] = ''; 和 $config['uri_protocol'] = 'REQUEST_URI'; 但是当我转到我的控制器 /admin/ 时,除非我在 URL 末尾输入“/index”,否则不会运行索引。我的 htaccess 文件是否不允许这样做?
谢谢你的帮助