php - 我无法从 codeigniter 3.1.11 中的 URl 中删除 index.php
问题描述
我尝试从可用的文档中将.htaccess添加到根文件夹中。我搜索了整个互联网,但没有解决我的问题。
.htaccess 中的代码
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
更改了 apache 文件httpd
LoadModule rewrite_module modules/mod_rewrite.so
谁能告诉我可能是什么原因?
解决方案
Find the below code
$config['index_page'] = "index.php"
Remove index.php
$config['index_page'] = ""
在 .htaccess 文件中写入以下代码
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
推荐阅读
- reactjs - 是否可以创建一个反应组件并在其他项目 html 中使用它?
- python - pandas - 根据“下一个”行值创建新列
- angular - IIS Angular Page 无法加载资产文件夹/页面
- sql - SQL Server 替换
- list - 如何从下面的代码中消除循环
- powershell-core - 用于 Linux 的 Powershell 核心 sqlserver 模块中缺少 Invoke-Sqlcmd cmlet
- metal - 金属中的文本渲染
- azure - 从本地 SSIS 处理 Azure SSAS 多维数据集:我需要一个虚拟 Office365 帐户吗?
- css - 悬停状态不适用于异物
- android - 在适配器中获取 ArrayIndexOutOfBoundsException