# Getting a 404 with redirected requests for APPEND\_SLASH in logging middleware

**URL:** https://forum.djangoproject.com/t/getting-a-404-with-redirected-requests-for-append-slash-in-logging-middleware/22722
**Category:** Deployment
**Created:** [August 2, 2023, 12:57pm UTC](https://forum.djangoproject.com/t/getting-a-404-with-redirected-requests-for-append-slash-in-logging-middleware/22722 "2023-08-02T12:57:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![palexaki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/palexaki/32/15121_2.png) [@palexaki](https://forum.djangoproject.com/u/palexaki)
#### Post date: [August 2, 2023, 12:57pm UTC](https://forum.djangoproject.com/t/getting-a-404-with-redirected-requests-for-append-slash-in-logging-middleware/22722/1 "2023-08-02T12:57:43Z")

</div>

I recently updated from django 3.2 to 4.2 and am getting a 404 in my logging middleware when a request gets a redirect on requests where APPEND\_SLASH applies. My application has the APPEND\_SLASH setting enabled and when I call `curl -D - http://<host>/health`, when `/health/` is the correct path, `curl` correctly gets a 301 response but it gets passed to my custom logging middleware as a 404. In the past the redirect did not get passed to the middleware and these requests were not present in the logs.

I also checked and in django 4.1 it has the same behavior as in 3.2. What changed in 4.2 for this to happen? I cannot find any relevant information in the release notes.

If helpful, this is my list of middleware:

```auto
MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'myapp.middleware.LoggingMiddleware'
]

```

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [August 2, 2023, 4:10pm UTC](https://forum.djangoproject.com/t/getting-a-404-with-redirected-requests-for-append-slash-in-logging-middleware/22722/2 "2023-08-02T16:10:18Z")

</div>

Yes, this is now intentional.

See [https://code.djangoproject.com/ticket/33700](https://code.djangoproject.com/ticket/33700)  
and [Fixed #33700 -- Skipped extra resolution for successful requests not … · django/django@fbac2a4 · GitHub](https://github.com/django/django/commit/fbac2a4dd846b52c4f379eacb5bab654fe9540cc)
