I have a local site installed with VVV that I've installed in a subdirectory to try and mimic the production environment.
/m/
Pages are working as expected
/m/some-page/
But requests to wp-admin redirect to a URL with an extra directory in the path
/m/wp-admin -> /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 .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.
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/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.
Share Improve this question asked Oct 9, 2015 at 20:16 ColinColin 1212 gold badges3 silver badges8 bronze badges1 Answer
Reset to default 1Remove '/m' from '/m/index.php?$args;'