• Hello,

    I installed WordPress using this Docker image. In installed WordPress on a sub-folder (https://thibault.vlacich.fr/blog).

    I’m using Traefik for routing. Here’s my docker-compose file:

    
    version: '3.7'
    
    networks:
      http_network:
        external: true
      thibaultvlacich:
        external: false
    
    services:
      database:
        image: mariadb:latest
        command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', '--default-authentication-plugin=mysql_native_password']
        volumes:
          - .docker/data/db:/var/lib/mysql
        environment:
          MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
          MYSQL_DATABASE: ${MYSQL_DATABASE}
          MYSQL_USER: ${MYSQL_USER}
          MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        networks:
          - thibaultvlacich
    
      wordpress:
        depends_on:
          - database
        image: wordpress:latest
        volumes:
          - ./wordpress/wp-content:/var/www/html/wp-content
        environment:
          WORDPRESS_DB_HOST: database:3306
          WORDPRESS_DB_USER: ${MYSQL_USER}
          WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
          WORDPRESS_DB_NAME: ${MYSQL_DATABASE}
        labels:
          - traefik.enable=true
          - traefik.frontend.rule=Host:thibault.vlacich.fr;PathPrefix:/blog;PathPrefixStrip:/blog
          - traefik.port=80
          - traefik.docker.network=http_network
        networks:
          - thibaultvlacich
          - http_network
    

    Everything is working fine, at the exception of the admin. When I go to https://thibault.vlacich.fr/blog/wp-admin, I’m redirected to https://thibault.vlacich.fr/wp-admin, and then can’t access the admin.

    Any idea how I could fix that? (Both WP_HOME and WP_SITEURL are correctly set to https://thibault.vlacich.fr/blog)

    • This topic was modified 5 years, 1 month ago by Thibault.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi

    did you tried this ?

    https://thibault.vlacich.fr/blog/wp-login.php

    Thanks
    Ahir

    Thread Starter Thibault

    (@thibaultv)

    Login is working fine, it’s when I want to access the admin that it’s not working.

    did you checked htaccess code ?

    its look like something like this.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
    # END WordPress

    Thanks
    Ahir

    if that does not work then can you do this:

    Log in to your hosting Control Panel account.
    Go to public_html folder.
    Locate the wp-config.php file for your WordPress website.
    Edit the wp-config.php file.
    To enable WP_Debug, add the following code to the end of the file:

    define( 'WP_DEBUG', true );

    and see if you get any error related to path.

    Thanks
    Ahir

    Thread Starter Thibault

    (@thibaultv)

    No issue with the htaccess, URL rewriting is working perfectly fine.

    I’m not seeing any error with WP_DEBUG on true.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t access admin when WordPress is in a subfolder’ is closed to new replies.