The Difference Between Subdomains and Subdirectories for SEO; How to Use Reverse Proxies to Resolve Subdomain Issues

The Difference Between Subdomains and Subdirectories for SEO; How to Use Reverse Proxies to Resolve Subdomain Issues
CapGo AI founder shares AI SEO insights at Ahrefs Summit

In SEO (search engine optimization), the choice between subdomains and subdirectories can have a real impact on a website's ranking and traffic performance, despite Google's official claim that there is no significant difference between the two in terms of SEO.

🧠 I. SEO Differences Between Subdomains and Subdirectories

What are Subdomains and Subdirectories?

  • Subdomain:
    Example: blog.example.com
    A “separate website” under the main domain, treated by search engines as an independent site.
  • Subdirectory:
    Example: example.com/blog
    A directory under the main site, part of the same website structure.

Differences in Actual SEO Performance

✅ Actual experience shows:Placing content in a subdirectory often results in 2x-3x better natural SEO performance, especially in the early stages or when aiming to share weight with the main site.

🔄 II. Map Subdomains to Subdirectories Using a Reverse Proxy

To balance flexibility in development and deployment (such as deploying blogs or applications on independent servers or systems), you can use a reverse proxy to “map” subdomain content to subdirectory paths on the main domain.

🛠 Example: Using Nginx to implement Subdomain -> Subdirectory mapping

Scenario:

  • You have a blog system at blog.example.com
  • You want users to be able to access it via example.com/blog/

🔧 Nginx configuration example:

server {
listen 80;
server_name example.com;

location /blog/ {
proxy_pass http://blog.example.com/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;

# Prevent path confusion
proxy_redirect off
;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# Clean up subdirectory paths (optional, depending on application support)
sub_filter_once off
;
sub_filter 'href="https://capgo.ai/blogs/' 'href="https://capgo.ai/blogs/blog/';
sub_filter 'src="https://capgo.ai/blogs/' 'src="https://capgo.ai/blogs/blog/';
}
}

Read more

Cold Email回复率为什么低?影响  回复率的 6 个核心因素

Cold Email回复率为什么低?影响 回复率的 6 个核心因素

很多人做 Cold Email 时,会把注意力全部放在一件事情上:邮件怎么写得更 personalized? 但这其实只是很小的一部分。 一封邮件有没有人回复,不是由某一句文案决定的,而是多个因素共同作用的结果。 经常有客户问,为什么我们的邮件点开率跟回复率可以这么高呢? 我更喜欢用一个简单的公式来理解 Cold Email: Cold Email 回复率公式 Reply Rate ≈ Deliverability × ICP × Timing × Pain × Credibility × Offer 也就是: 回复率 ≈ 送达率 × 客户匹配度 × 时机 × 痛点 × 可信度 × Offer 为什么这里用的是“乘法”,而不是加法? 因为 Cold Email 有一个非常残酷的特点: 任何一个关键因素接近 0,最后的结果都可能接近 0。 例如,你的邮件写得非常漂亮,但根本没有进入 Inbox,

By CapGo AI - by YG