Wordpress adds trailing slash

1. Caddy version (caddy version):

2

2. How I run Caddy: docker through traefik reverse proxy and with php-fpm

a. System environment:

Docker / Ubuntu

b. Command:

docker-compose
```#### c. Service/unit/compose file:

FROM caddy:alpine
ARG WEBROOT=/var/web
COPY Caddyfile /etc/caddy/Caddyfile


#### d. My complete Caddyfile or JSON config:

:80
root * {env.WEBROOT}
file_server
php_fastcgi app:9000
log
encode gzip


### 3. The problem I'm having:

Wordpress adds trailing slashes after assets and do a 301 redirect. Such as `/wp-content/test.txt` -> `/wp-content/test.txt`


### 4. Error messages and/or full log output:

### 5. What I already tried:
Tried to add redirects, but I read it's not necessary

### 6. Links to relevant resources:
You can see example at `https://dockerbridge.com/wp-content/test.txt`

Sorry for the messy post, it was almost impossible to avoid this - no idea what triggers it!:

Sorry, new users can only put 4 links in a post. Remember to enclose Caddyfiles and logs with backticks (```) on empty lines immediately before and after the text - domains posted this way do not count as links.

It turned out that I forgot to mount wp-content on the caddy server, only did it on phpfpm

The ``` need to be on their own lines, nothing else beside them.

Glad you figured out your problem though!

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.