dongya2578 2013-06-18 11:09
浏览 53
已采纳

.htaccess配置,codeIgniter和facebook php sdk

I have to access http://example.com/ABC/some-controller. As per CodeIgniter you have to follow http://example.com/ABC/index.php/some-controller. Now I am using .htaccess to remove index.php. The problem I am facing is , if I use .htaccess file , my facebook login is not working because somehow it is not picking up the GET variables set by FB.

My directory listing is as follows :

public_html
  ABC  (codeigniter folders inside this directory)
    applications 
    system
    .htaccess
    index.php

Now contents of my .htaccess to remove index.php from url :

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

In config.php I have set the uri protocol to AUTO. Thing to note here is , if I don't use ? in last line (of .htaccess), it won't let me display page without index.php and throws error No file specified . If I use ? then everything is fine , except , that my facebook login stops working when I add this in .htaccess file, it keeps redirecting again and again . each time with a new code in get parameter. In my localserver everything is working fine. (In my localserver's .htaccess file I am not using ? in last line, so I don't have to write index.php nor I have problem in fb login). I guess code of my fb login is correct as it is working on localhost, so not posting that code here. Please help me out to config my .htaccess for webserver so that it can use "get" parameters also. I am using Arvix web hosting.

  • 写回答

2条回答 默认 最新

  • drdyszuy488152 2013-11-21 19:58
    关注

    Got it fixed by switching the web server from Arvix to Amazon AWS.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 方程如何编到C语言!
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案
  • ¥50 winform中使用edge的Kiosk模式
  • ¥15 关于#python#的问题:功能监听网页
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了