404 error – Getting 404 when static files have “?ver=x.y” suffix


I am running wordpress 6.0.3 under apache using the official docker container. I have a clean install with no themes or plugins added. The following gives me a 404:

curl http://localhost:8080/wp-content/themes/twentytwentytwo/style.css/?ver=1.2
# gives 404

However, without the query part of the URL, it works

curl http://localhost:8080/wp-content/themes/twentytwentytwo/style.css
# works

The only change I made to the official image was to make it stateless according to the instructions on the official docker image readme, so my Dockerfile is:

FROM wordpress:6.0.3-apache
WORKDIR /usr/src/wordpress

RUN set -eux; \
    find /etc/apache2 -name '*.conf' -type f -exec sed -ri -e "s!/var/www/html!$PWD!g" -e "s!Directory /var/www/!Directory $PWD!g" '{}' +; \
    cp -s wp-config-docker.php wp-config.php

Any idea why I’m getting 404 in this way? How might I debug?

Alex Flint 1 month 2022-10-30T11:31:22-05:00 0 Answers 0 views 0

Leave an answer