gpt4 book ai didi

php - 从子文件夹中的 codeigniter 中删除 index.php

转载 作者:搜寻专家 更新时间:2023-10-31 21:02:26 26 4
gpt4 key购买 nike

我的 codeigniter 安装在托管服务器上的 admin_new 文件夹中,安装的 codeigniter 的路径是 public_html/vishwa/admin_new/ 我正在尝试从 url 中删除 index.php。

我已如下更改我的 .htaccess 文件。

RewriteEngine on
RewriteBase /vishwa/admin_new/
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

我查看了论坛,它说 mode_rewrite 在托管商上默认启用。但它显示错误,如未指定输入文件

我还更改了 config.php 中的配置设置,如下所示:

$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

但它仍然显示相同的错误。为什么会出现这种类型的错误,我该如何解决。

最佳答案

试试这个

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

关于php - 从子文件夹中的 codeigniter 中删除 index.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39449020/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com