Title: 404 Error when testing with Docker Compose
Last modified: August 22, 2023

---

# 404 Error when testing with Docker Compose

 *  Resolved [coder1987](https://wordpress.org/support/users/coder1987/)
 * (@coder1987)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/)
 * Hello, thank you for making this plugin. I have created the following compose.
   yaml file:
 *     ```wp-block-code
       version: '3.1'
   
       services:
   
         wordpress:
   
           image: wordpress
   
           restart: always
   
           ports:
   
             - 8080:80
   
           environment:
   
             WORDPRESS_DB_HOST: db
   
             WORDPRESS_DB_USER: exampleuser
   
             WORDPRESS_DB_PASSWORD: examplepass
   
             WORDPRESS_DB_NAME: exampledb
   
           volumes:
   
             - wordpress:/var/www/html
   
         db:
   
           image: mysql:5.7
   
           restart: always
   
           environment:
   
             MYSQL_DATABASE: exampledb
   
             MYSQL_USER: exampleuser
   
             MYSQL_PASSWORD: examplepass
   
             MYSQL_RANDOM_ROOT_PASSWORD: '1'
   
           volumes:
   
             - db:/var/lib/mysql
   
       volumes:
   
         wordpress:
   
         db:
       ```
   
 * And then navigated to localhost:8080 and installed your plugin. 
   Then I added
   a new redirection, using “/test” as the source url, and [https://example.com](https://example.com)
   as the target url.When I click the link “/test” in on the newly added redirect,
   I receive a 404 error.“Not Found
 * The requested URL was not found on this server.Apache/2.4.56 (Debian) Server 
   at localhost Port 8080″
   I imagine this might be related to the fact that I am
   running in a Docker container. But I received no errors when installing the plugin,
   including the step where the REST API was setup.Also I have checked the Support
   tab, and everything is listed as “Good”. I get a 200 status code when using the
   checker on [https://example.com](https://example.com). It mentioned sometimes
   the cache can be to blame for unexpected behavior, so I opened another browser
   and navigated to localhost:8080/test, and still receive the 404. If I remove /
   test, my local WordPress blog loads normally.
    -  This topic was modified 2 years, 9 months ago by [coder1987](https://wordpress.org/support/users/coder1987/).
    -  This topic was modified 2 years, 9 months ago by [coder1987](https://wordpress.org/support/users/coder1987/).

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [coder1987](https://wordpress.org/support/users/coder1987/)
 * (@coder1987)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/#post-16990817)
 * I was able to solve this issue by navigating to Settings -> Permalinks and changing
   from the default selection (Plain) to Post Name.
   Perhaps during the setup, it
   can alert the user about this problem.
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/#post-16990906)
 * > Perhaps during the setup, it can alert the user about this problem.
 * It’s not really part of the plugin to do that, and it is expected that your WordPress
   is setup correctly.
 *  Thread Starter [coder1987](https://wordpress.org/support/users/coder1987/)
 * (@coder1987)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/#post-16991315)
 * Hi,
   It is not obvious that having the default option for permalink format selected
   will break this plugin, as there is no explicit error message which indicates
   this.That is to say, this plugin does not work with a fresh WP install. So when
   you say “it is expected that your WordPress is setup correctly”, when I click
   the Support tab, it shows all tests as having a “Good” status. And so it would
   be fair to assume based on these tests that my WordPress is setup “correctly”.
   While this was a rather poor user experience, I was glad to be able to fix the
   problem on my own, by randomly changing a setting that I had a feeling might 
   fix the 404 error. Sometimes you get lucky!
    -  This reply was modified 2 years, 9 months ago by [coder1987](https://wordpress.org/support/users/coder1987/).
    -  This reply was modified 2 years, 9 months ago by [coder1987](https://wordpress.org/support/users/coder1987/).
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/#post-16991367)
 * The plugin works fine whether your permalink settings are plain or custom. Your
   WordPress setup will need to allow permalinks to be used. This is something the
   plugin cannot check.
 * I do not know why your setup did not originally work, but maybe your .htaccess
   was not created properly.
 *  Thread Starter [coder1987](https://wordpress.org/support/users/coder1987/)
 * (@coder1987)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/#post-16991395)
 * [@johnny5](https://wordpress.org/support/users/johnny5/) I just ran a test where
   I changed the Permalink type back to plain, and opened an incognito browser, 
   navigated to localhost:8080/test, and it 404’d. Turned it back to Post Name for
   permalinks, went to the same url, and the redirect worked.
   I can share any server
   logs that might diagnose the problem further.
    -  This reply was modified 2 years, 9 months ago by [coder1987](https://wordpress.org/support/users/coder1987/).
 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/#post-16991429)
 * I am unable to reproduce that behaviour and it is possibly caused by your Docker
   setup. If you have more specific details then you can add them to Github here:
 * [https://github.com/johngodley/redirection/](https://github.com/johngodley/redirection/)

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘404 Error when testing with Docker Compose’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [John Godley](https://wordpress.org/support/users/johnny5/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/404-error-when-testing-with-docker-compose/#post-16991429)
 * Status: resolved