加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

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

发布时间:2020-12-13 21:56:33 所属栏目:PHP教程 来源:网络整理
导读:当我在浏览器中运行CI项目时,使用localhost / hr,它将我重定向到localhost / dashboard /. 搜索了不同的解决方案,但没有得到它的工作.这是我在“htdocs / hr”文件夹中的.htaccess文件 RewriteEngine onRewriteCond $1 !^(index.php|images|robots.txt)Rew
当我在浏览器中运行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文件中设置重写基础(ci).

所以你现在有

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

你应该把它改成

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读