CMS Development

gio-nab
Participant | Platinum Partner
Participant | Platinum Partner

Hosting HubSpot blogs in a subdirectory of an external root-domain

SOLVE

Hi there,

 

I've got a question you might be able to help with in regards to domains, subdomains & subdirectories.

 

For the majority of our clients we use WordPress as their company website / CMS (domain.com or www.domain.com). For the customers blogs however, we use HubSpot, which means that the blogs are usually hosted on a subdomain (blog.domain.com).

There's been lots of discussions in the SEO world that are almost always in favour of the fact that having your blog on the root domain (domain.com/blog or www.domain.com/blog) instead of its own subdomain is highly beneficial.

We produce a lot of high quality blog content for clients, but are definitely suffering by being on a subdomain.

 

Unless your root domain (and CMS) is hosted on HubSpot, you are unable to use a subdirectory for your blog. At least they say they don't support it.

 

We're currently in need of a solution hoping that there is a more complex solution that HubSpot prefers not to mention perhaps as the majority of their customers won't have the ability to carry it out with ease.

 

You can see some discussions with HubSpot on this feature/ability:
- https://community.hubspot.com/t5/Blog-Website-Page-Publishing/Subfolder-vs-Subdomain/td-p/2165
- https://growth.org/blog/the-sub-domain-vs-sub-directory-seo-debate-explained-in-one-flow-chart

 

If your initial question is "why not just move the blog to WordPress" or the other way, WordPress is used by us because the flexibility, control etc we have over the website. Where as HubSpot is used for blogging, landing pages, forms etc and is better for reporting purposes, so we'd prefer to keep the two as is if possible (though blog performance is definitely a priority).

 

Thank you!
Hope to hear from you soon.

0 Upvotes
1 Accepted solution
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Hosting HubSpot blogs in a subdirectory of an external root-domain

SOLVE

Hi @gio-nab - 

This isn't necessarily a limitation of HubSpot and it's highly unlikely it would be a feature on the road map. This all comes down to the technologies you choose to use and your server configurations (There might be some magical configuration that gets you close with a load balancer). 

 

Domain names are simple human-readable strings that you put into a browser URL bar, but in the background, what it's actually doing is hitting a DNS server to lookup the correlating IP address of the server that is suppose to deliver the content to the browser. 

 

Since you are using 2 different technologies on 2 different servers, you have 2 different IP addresses. HS will have an IP address and Wordpress will have an IP address. It's not possible to split the traffic from a browser request to the DNS lookup of the IP address. The DNS server will not know which IP address the browser is expecting to get back. 

 

Luckily, they invented subdomains that can give you the ability to setup traffic routing based on a domain name prefix. 

View solution in original post

2 Replies 2
David_Alb
Participant

Hosting HubSpot blogs in a subdirectory of an external root-domain

SOLVE

3 years later, but I need to answer, because the currently Accepted Solution is misleading. Maybe just because is outdated.

 

There is a possible solution to your problem. I will refer to your original server hosting your web ("example.com") as server A and wherever you host your blog server B.

 

The solution is to use a reverse proxy to direct any request to "example.com/blog". Reverse proxies work like regular proxies (whose full name is forward proxies). The reverse proxy will intercept all requests to "example.com", or any subdirectory. You can configure it to redirect all requests to server A, except for those going to "example.com/blog/*", which you can redirect to server B. It is not an easy process, but is explained in this Hubspot guide (is a pdf file that explain how to set up a reverse proxy using AWS)

 

An alternative, which I do not know if will work, depends on Hubspot partners for Wordpress hosting. I am assuming that if you use one of those partners, it is equivalent as having your website directly hosted in Hubspot. If that is the case, then you can simply point "example.com/blog" to a blog created in Hubspot. I insist that I do not know if this will work, but anyone interested can research and reply this message.

 

I assume you already solved this problem 3 years ago, but answered anyways for people facing a similar problem (like myself currently)

tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Hosting HubSpot blogs in a subdirectory of an external root-domain

SOLVE

Hi @gio-nab - 

This isn't necessarily a limitation of HubSpot and it's highly unlikely it would be a feature on the road map. This all comes down to the technologies you choose to use and your server configurations (There might be some magical configuration that gets you close with a load balancer). 

 

Domain names are simple human-readable strings that you put into a browser URL bar, but in the background, what it's actually doing is hitting a DNS server to lookup the correlating IP address of the server that is suppose to deliver the content to the browser. 

 

Since you are using 2 different technologies on 2 different servers, you have 2 different IP addresses. HS will have an IP address and Wordpress will have an IP address. It's not possible to split the traffic from a browser request to the DNS lookup of the IP address. The DNS server will not know which IP address the browser is expecting to get back. 

 

Luckily, they invented subdomains that can give you the ability to setup traffic routing based on a domain name prefix.