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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统