익명 20:29

Access wordpress blog on subdirectory /blog that is running on subdomain

Access wordpress blog on subdirectory /blog that is running on subdomain

I have my main site https://mysite.com in nextjs and wordpress blog on subdomain https://blog.mysite.com. They both are hosted on different servers and diff hostings.

I need my blog to be accessible via subdirectory in main site - https://mysite.com/blog

I have successfully proxied nextjs https://mysite.com/blog to see blog but blog's internal links, pages, posts, media is still pointing to subdomain.

async rewrites() {
return [
  {
    source: '/blog',
    destination: 'https://blog.mysite.com/',
  },
  {
    source: '/blog/:slug',
    destination: 'https://blog.mysite.com/:slug', // Matched parameters can be used in the destination
  },
]

},

I have tried many solutions but end up breaking wordpress config

Need help

solutions tried

  • https://medium.com/one-weekend-at-a-time/how-to-reverseproxy-wordpress-at-blog-from-any-sub-domain-ec8e5159e305
  • https://proxyscrape.com/blog/using-a-reverse-proxy-to-install-a-wordpress-blog-for-enhanced-seo


Top Answer/Comment:

There are a few ways to do this. The key is to get the WordPress config right and the config depends on how you are proxying.

  • DIY approach with Cloudflare Workers: https://shapo.io/blog/wordpress-blog-on-a-subdirectory-with-cloudflare/
  • Consulting service for CloudFlare Workers: https://slashblog.co/
  • Paid proxy (general, for your entire site): https://hostforward.io/
  • Paid proxy (WordPress specific, just for blog/): https://pressproxy.io/
상단 광고의 [X] 버튼을 누르면 내용이 보입니다