0

I have a local site installed with VVV that I've installed in a subdirectory to try and mimic the production environment.

http://localtest.dev/m/

Pages are working as expected

http://localtest.dev/m/some-page/

But requests to wp-admin redirect to a URL with an extra directory in the path

http://localtest.dev/m/wp-admin -> http://localtest.dev/m/m/wp-admin/

My localtest.conf is as follows:

server {
# Determines the port number that nginx will listen to for this
# server configuration. 80 is the default http port.
listen       80;

# Listen for HTTPS requests as well
listen       443 ssl;

# Tells nginx what domain name should trigger this configuration. If
# you would like multiple domains or subdomains, they can be space
# delimited here. See http://nginx.org/en/docs/http/server_names.html
server_name  localtest.dev ~^localtest\.\d+\.\d+\.\d+\.\d+\.xip\.io$;

# Tells nginx which directory the files for this domain are located
root         /srv/www/localtest/htdocs;
index       index.php;
# Subdirectory location settings

location /m/ {
    try_files $uri $uri/ /m/index.php?$args;
}

# Includes a basic WordPress configuration to help with the common
# rules needed by a web server to deal with WordPress properly.
include /etc/nginx/nginx-wp-common.conf;
}

Any advice would be greatly appreciated.

1

Remove '/m' from '/m/index.php?$args;'

  • Why? What will this do? Can you add more of an explanation please - the post was autoflagged as low quality. – Howdy_McGee Oct 10 '15 at 3:47
  • I believe you are starting with location /m/ and then going to location /m/index.php?$args. This is causing the /m/m/index.php?$args. – Jeff Mattson Oct 11 '15 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.