codeigniter 通过 IE、Safari、Chrome 登录时出现问题?

发布于 2024-10-10 06:07:48 字数 895 浏览 0 评论 0原文

在 localhost 中一切正常,但我从其他浏览器(如 Safari 和 Chrome)登录时遇到问题,在 Firefox 中则没问题。也许是因为 htaccess 或者可能是其他原因。

我尝试了很多搜索但没有找到解决方案。我的 htaccess 文件看起来像这样:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /


RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

我的服务器文件夹层次结构看起来像这样:

public_html
L application
  system
  css
  images
  .htaccess

application/config/config.php 看起来像这样

$config['index_page'] = "index.php?";
$config['uri_protocol'] = 'QUERY_STRING';

我也使用了 hmvc。 有什么帮助吗?

Everything works fine in localhost but I have a problem login from other browsers like Safari and Chrome, in firefox it's okay. Maybe it is because of htaccess or may be other.

I tried a lot of searching but come to no solution. My htaccess file look like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /


RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

My server folder hierarchy looks like this:

public_html
L application
  system
  css
  images
  .htaccess

application/config/config.php looks like this

$config['index_page'] = "index.php?";
$config['uri_protocol'] = 'QUERY_STRING';

I have used hmvc too.
Any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蒗幽 2024-10-17 06:07:48

您是否更新了配置文件中的 base_url 变量以反映新服务器?

Have you updated the base_url variable in your config file to reflect the new server?

別甾虛僞 2024-10-17 06:07:48

我也有同样的问题。我发现的是 Native 会话类解决方案,它帮助我克服了同样的问题。看一下 CI Native 会话。这也适用于所有主要浏览器。
http://codeigniter.com/wiki/Native_session/

I was having the same issue. What I found is the Native session class solution which helped me to overcome with the same problem. Take a look at CI Native session. This will also works with all major browsers.
http://codeigniter.com/wiki/Native_session/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文