【发布时间】:2023-04-03 08:35:01
【问题描述】:
我对 Code igniter 和通过 MVC 架构处理表单提交完全陌生。因为,我搜索并尝试了堆栈溢出本身给出的所有灵魂和代码,以从 url 中删除 index.php,但所有这些都没有工作。我知道缺少某些东西,但由于我是 CI 新手,所以我无法识别它。
这是我下面的 .htaccess 代码,
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
我也设置了 $config['index_page']=' ';和 $config['uri_protocol']='REQUEST_URI';在 config.php 文件中。
注意:我的 CI 版本是 3x
【问题讨论】:
-
您在本地服务器上工作?哪个操作系统?
-
是的,我正在使用 win10 操作系统 ..
-
你的 htaccess 不正确
-
@AnandPandey 有什么解决方案吗?
标签: php codeigniter xampp