简体   繁体   中英

Codeigniter Rest Server denies just one request

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

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-deploy branch 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM