0

I have a landing page and a wordpress site in a subfolder

example.com -> landing page
example.com/blog -> wordpress

I want to serve the wordpress site on a different server. I created a server( blog.example.com) and moved all files and databases that belong to wordpress. I have changed nginx configuration (example.com) a bit and added those lines below

  location /blog {
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   Host      $http_host;
    proxy_pass https://blog.example.com:443 ;
        }

Now, Any user heading to example.com/blog/posts sees the content on blog.example.com/blog/posts without redirecting to blog.example.com . But after loading the first page (posts) when he clicks any link , he is redirected to blog.example.com, which is not desired action.
I have to set siteurl and home as blog.example.com on blog.example.com. Because If I set siteurl and home as example.com/blog, it redirects to example.com when the first page is loaded . So how can I serve a wordpress site in a subfolder proxied on different server?

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • Great question! Have same issue with SvelteKit. My site is on svelte, and I would like to have blog in domain on wordpress. Regarding your issue (I have the same not fixed yet), have you tried: 1)Setting URL's in WordPress setting to "example.com" or "example.com/blog" ? (I would try both) 2)Setting links (perma links) as example.com/%posts%/ or example.com/blog/%posts%/ 3)Configuring htaccess file so it will understand the proxy made As mentioned I haven't yet solved it – Ryszard Kozłowski Apr 23 '23 at 17:48

0 Answers0