codeigniter 通过 IE、Safari、Chrome 登录时出现问题?
在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否更新了配置文件中的 base_url 变量以反映新服务器?
Have you updated the base_url variable in your config file to reflect the new server?
我也有同样的问题。我发现的是 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/