I am hosting a WordPress page on wordpress, so my domain is xyz.wordpress.com. I’m using a proxy_pass in nginx so that my site is available under https://mywebsite.com/blog. My settings are like this

location ~* ^/blog {
    proxy_set_header Accept-Encoding "";
    sub_filter 'https://xyz.wordpress.com/' '/blog/';
    sub_filter_once off;
    rewrite ^/blog/(.*) /$1 break;
    rewrite ^/blog / break;
    proxy_pass     https://xyz.wordpress.com;

Everything works, when I visit /blog I get the wordpress blog, when I visit a post it works, so sub-urls such as /blog/author/xzy is not a problem.

However, when wanting to reed the feed via https://mywebsite.com/blog/feed I get redirected to https://mywebsite.com/feed, and I don’t know why. Why does it happen only for the feed url, not for the other ones?

The feed on the wordpress page is available under xyz.wordpress.com/feed so I get where he get’s the url from, but why does he redirect for the feed, but not the other stuff?

Read more here: Accessing wordpress feed redirects to root folder


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: