【问题标题】:Code Igniter redirection with no error but page not showingCodeigniter 重定向没有错误,但页面未显示
【发布时间】:2018-03-19 11:02:48
【问题描述】:

我与您联系,因为我的代码点火器有一点问题。 我有一个重写 url 的 .htaccess。例如,当我单击联系人时,URL 会显示并加载:localhost:8888/my_site/contact 但页面保持不变。

所以我真的不明白发生了什么?

您是否已经遇到过同样的问题?

你有什么想法吗?

提前感谢你们的帮助:)

这是我的 htaccess 文件(已正确加载,我尝试添加一个随机行并显示错误,所以很好):

Options +FollowSymlinks -Indexes
RewriteEngine On
#RewriteBase /

## in case the URL is not an actual FILE
RewriteCond %{REQUEST_FILENAME} !-f

## or an actual directory
RewriteCond %{REQUEST_FILENAME} !-d

## send everything to the index, for MVC
RewriteRule ^.*$ ./index.php

DirectoryIndex index.php index.html

【问题讨论】:

  • 感谢您的快速答复。我在配置中的 indexpage 已经设置为:'' 当我按照您的主题中所述更改 htaccess 时,我的页面显示 404 not found。而且这个htaccess反正也不好。
  • 使用我提到的htaccess
  • 您提到的 htaccess 在我的网站上出现 404 错误:/
  • 没办法。它是常见的 htaccess,这是我 2-3 年来一直使用的

标签: php codeigniter


【解决方案1】:

试试这个.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L]

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-07-12
  • 2017-09-07
  • 1970-01-01
  • 1970-01-01
  • 2020-03-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多