# Correctly routing a path to a wordpress container

**URL:** <https://community.traefik.io/t/correctly-routing-a-path-to-a-wordpress-container/1274>\
**Category:** Traefik v1\
**Tags:** docker\
**Created:** [August 19, 2019, 10:39pm UTC](https://community.traefik.io/t/correctly-routing-a-path-to-a-wordpress-container/1274 "2019-08-19T22:39:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudeman](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dudeman](https://community.traefik.io/u/dudeman)\
**Post date:** [August 19, 2019, 10:39pm UTC](https://community.traefik.io/t/correctly-routing-a-path-to-a-wordpress-container/1274/1 "2019-08-19T22:39:36Z")

</div>

I'm trying to use traefik to route a path to a wordpress container. When I attempt to access "localhost/blog", I can see the url is routed to "[http://localhost/wp-admin/install.php](http://localhost/wp-admin/install.php)" but I get a 404 page not found error. Ideally, I'd like to have the wordpress container live at port 8002 and then tell traefik to direct requests to /blog to the wordpress container at 8002. The port thing really confuses me so I'm hoping someone can help me out. Here's my docker-compose file:

```auto

version: '3'

services:
  reverse-proxy:
    image: traefik # The official Traefik docker image
    command: --api --docker # Enables the web UI and tells Traefik to listen to docker
    ports:
      - "80:80" # The HTTP port
      - "8080:8080" # The Web UI (enabled by --api)
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker eventsdoc
    networks:
      - test_network
      - internal
 
  db:
    image: mysql:5.7
    volumes:
      - db_data:/tmp/dbdata
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    networks:
      - test_network
      - internal
  
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    networks:
      - test_network
      - internal
    ports:
      - "8002:80"      
    labels:
      - "traefik.backend=wordpress-example"
      - "traefik.frontend.rule=Host:localhost;PathPrefixStrip:/blog"
      - "traefik.docker.network=test_network"
      - "traefik.enable=true"
      - "traefik.port=80"

    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress

volumes:
    db_data: {}

networks:
  test_network:
    external: true
  internal:
    external: false

```

---

<div class="post-metadata">

**Author:** ![JSAnyone](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jsanyone/32/4016_2.png) [@JSAnyone](https://community.traefik.io/u/JSAnyone)\
**Post date:** [July 17, 2021, 6:48pm UTC](https://community.traefik.io/t/correctly-routing-a-path-to-a-wordpress-container/1274/2 "2021-07-17T18:48:38Z")

</div>

Hi,  
Could you solve this?
