dpgvdfg321041670 2015-12-01 15:24
浏览 78
已采纳

Codeigniter Rest Server只拒绝一个请求

TL;DR

I get a 404 (Not Found) error on calling an API method (api/auth/authenticated~GET). I only get this on my live-server, not on local and not on any other methods.

The Problem

I use Codeigniter with a Rest-Server library. I have a simple method api/auth/authenticated(GET) that returns true if the user is logged in and false if not. On the live-server this method gives me a 404 (Not Found) error. Other calls to the same api class work, for example api/auth/login(POST) works and api/auth/logout(GET) works as well.

so how is this possible?

I have tried to delete the .htaccess file, but that didn't work. It can't be a typo since it works locally. Maybe some setting in Apache? But then why do the other methods work just fine?

I would be grateful for any ideas and hints.

my app

my server env

  • digital ocean droplet
  • Ubuntu 14.04
  • PHP 5.6.15
  • Apache 2.4.7
  • 写回答

1条回答 默认 最新

  • donglin9717 2015-12-02 02:28
    关注

    The worst problems are always the most stupid ones ...

    There should be a list on my desk.

    1. Check for typos (very important but was not the problem here)

    Now if we are working on Windows or OSX and everything works fine and then some parts just don't work on Linux this one is very important:

    2. Check filenames for case-sensitivity problems (also check the GIT config)

    The Problem was still a bit harder to find. I use Git to push my live-deploybranch to my remote repository, which is then picked up by Deploybot and uploaded to my server. Git doesn't care about case sensitivity on default and files will stay like they were first added forever. Thanks to this post i could just type one command to change it.

    git config core.ignorecase false
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错