Welcome! Log In Create A New Profile

Advanced

Installed WP in a subdir, can access wp-admin, but URLs are getting re-written without the subdir PATH. Where do I set this?

Anonymous User
April 30, 2018 04:36PM
I've installed WP in a site subdir.

I can now access wp-admin pages at the expected URL.

Sort of. I can get there manually, but my site config keeps redirecting, stripping URLs of the subdir path to WordPress.

My config now has

wp-config.php
<?php
define('WP_HOME', 'https://test.example.com/blog');
define('WP_SITEURL','https://test.example.com/blog');


and for Nginx

location ^~ /blog {
root /srv/www/test/wp/public;

index index.php;
try_files $uri $uri/ /blog/index.php?$args;

location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass phpfpm;
fastcgi_index index.php;
}
}

location / {
root /srv/www/test/public;

index index.php;
try_files $uri $uri/ /index.php?$args;

location ~ \.php {
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass phpfpm;
fastcgi_index index.php;
}
}



I visit

https://test.example.com/blog/wp-admin/plugins.php

It displays the correct page, the "Plugins" admin page. But the apparent URL (in the browser nav bar) is

https://test.example.com/

is missing the "/blog/wp-admin/plugins.php" part of the path.

AND links in the left nav bar are too.
For example, the link for 'Pages' shows on hover

https://test.example.com/edit.php?post_type=page

Click on it gives the expected

404 Not Found

But a MANUAL visit to

https://test.example.com/blog/wp-admin/edit.php?post_type=page

again gets me to the right page, with the URL displayed 'stripped' as

https://test.example.com/?post_type=page

I need to tell 'something' -- in WP or Nginx config I guess -- to use that path.

Question is: what?

AC
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Installed WP in a subdir, can access wp-admin, but URLs are getting re-written without the subdir PATH. Where do I set this?

Anonymous User April 30, 2018 04:36PM

Re: Installed WP in a subdir, can access wp-admin, but URLs are getting re-written without the subdir PATH. Where do I set this?

ph.gras April 30, 2018 05:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready