I have a reverse proxy in front of WP that maps some requests on the root example.com/page1/
over to the wp install wp.example.com/page1/
.
This works fine until the url is missing the trailing slash. WP returns a 301
that is the absolute url wp.example.com/page1
. I am trying to figure out how that URL is created, and hopefully change it.
I updated WordPress Address (URL)
and Site Address (URL)
in WP -> Settings, but that doesn't change the response from what I saw. Looking at the wp_posts
table the guid
has an absolute url, maybe that is used with a transform to the pretty url?
Can I just globally set the redirect URLS for WP, preferably to being relative, without breaking all the paths for the assets uploaded to wp_content
?
wp.example.com/page1
redirects towp.example.com/page1/
, then it's likely done viaredirect_canonical()
which among other things, avoids duplicate content penalty since the request URLs are identical and it's common for WordPress sites to use the URL with trailing slash than without it. – Sally CJ Nov 2 '20 at 20:16example.com/page1
redirects towp.example.com/page1/
– blu Nov 2 '20 at 22:37