cakephp / cakephp/app

access to `/.well-known/assetlinks.json` causes 500 error on Apache

Open
#1,097 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
PHP
Stars
387
Forks
392
Avg merge
6m
Merged PRs (30d)
1

Description

Preamble

Our app operates ID/password authentication and has thousands of Chrome Android clients. It is said that authenticating Chrome on Android clients sometimes causes GoogleAssociationService to access to /.well-known/assetlinks.json, even if the domain is not related to an Android app.

Problem Description

Apache web server returns 500 error for a GET request on /.well-known/assetlinks.json.
It may fire an alert and system administrators will lose their time.

Why 500 Error?

I found an error log entry in Apache error log file

[Mon Jul 13 03:21:13.148109 2026] [core:error] [pid 13] [client 192.168.48.1:59660] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I think internal redirects would mean rewrite on Apache.
I don't have enough knowledge to describe how the infinite rewrite loop occurs, but placing an empty directory named .well-known resolved the problem, and now Apache returns 404 not found error as expected. This would be a good work-around.

How to Resolve?

I think one of the following would make the app template better.

  • place /.well-known/.gitkeep empty file
  • update /.htaccess file (not /webroot/.htaccess) to prevent the infinite rewrite loop : the rewite-rule entry was added with the PR #558

Environment

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the app template's /.htaccess file and compare its rewrite rule with the rule introduced by PR #558; the issue specifically distinguishes it from /webroot/.htaccess. Reproduce a GET request to /.well-known/assetlinks.json on Apache and inspect the error log for the internal redirect loop. Done means the request returns an expected non-500 response, such as 404, without requiring a manually created .well-known directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, php
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.