Question

How to configure WordPress at mainsite.com/blog when it's really at blog.mainsite.com for SEO ?

Hi,

We do not wish to host our WordPress server on our main website. WordPress is a past/present/future trainwreck and I don’t want it causing problems with our main website. It needs its own Droplet at blog.mainwebsite.com

We can easily use Nginx proxy-pass to pass the user from mainwebsite.com/blog to blog.mainwebsite.com. This looks seamless to the user, and to Google for SEO on the address bar. Unfortunately, once any link on the WordPress install is clicked the address link is sent back to blog.mainwebsite.com. The reason for this is, the WordPress Address and Site Address config settings are set as blog.mainwesbite.com.

I tried changing WordPress Address and Site Address config settings to mainwebsite.com/blog but this result in errors.

I’m unsure what settings need to be changed on my WordPress config settings to make this possible. Anybody do this before?

Any help is much appreciated.

Regards,

W.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @wyatt541c2d7c8900f36752314,

What you are trying to achieve as far as I know is not achievable, at least in your current setup. You can’t have your subdomain load as mainwebsite.com/blog but it actually being blog.mainwebsite.com. Even more so when they are on a different Droplet/Server.

If they were on the same Droplet, maybe you can create some kind of an alias. Even with an alias, it won’t work as you expect. Additionally, even if you make it somehow work it will be messy and not worth it.

I strongly agree, either just staying with blog.mainwebsite.com or just adding your Blog as a directory inside your mainwebsite.com.