gpt4 book ai didi

php - 删除index.php codeigniter 3.0.6

转载 作者:行者123 更新时间:2023-12-03 19:33:04 25 4
gpt4 key购买 nike

我想像这样删除我的网址上的 index.php 。我使用 XAMPP。

localhost/3g_admin/home

首先,我在我的 codeigniter 3.0.0 版本上使用了这个 .htaccess,它工作得很好。

RewriteEngine on
RewriteBase /3G_admin
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

但是当我在 3.0.6 版本的 CodeIgniter 上使用这个 .htaccess 时,我需要声明这个

localhost/3g_admin/index.php/home

我已经将 config.php 设置为此。

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

还是没有运气。

我在这里做错了什么?

最佳答案

config.php中,更改

$config['index_page'] = 'index.php';

$config['index_page'] = '';

关于php - 删除index.php codeigniter 3.0.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36447336/

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