gpt4 book ai didi

php - CodeIgniter Localhost 重定向到 xampp 主屏幕

转载 作者:可可西里 更新时间:2023-11-01 13:49:13 25 4
gpt4 key购买 nike

当我在浏览器中运行 CI 项目时,使用 localhost/hr,它会将我重定向到 localhost/dashboard/

搜索了不同的解决方案,但没有成功。这是我在“htdocs/hr”文件夹中的 .htaccess 文件

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

注意:htdocs文件夹中没有.htaccess文件。

当我删除/重命名 index.php 文件并访问 htdocs 时出现错误。

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

我做错了什么,如何让它工作?

下面是我的 htdocs/hr 文件夹的屏幕截图

enter image description here

最佳答案

您需要在文件夹中的 .htaccess 文件中设置 RewriteBase,在您的例子中是 ci

所以你现在有

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

你应该把它改成

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ci/

就是这样。它现在可以工作了。

关于php - CodeIgniter Localhost 重定向到 xampp 主屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41427144/

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