Mobile app version of vmapp.org
Login or Join
Michele947

: How to move SEO from a separately hosted subdomain into main domain? I have a main domain: example.com and a subdomain: blog.example.com that I really want combined for SEO benefit, but my blog.example.com

@Michele947

Posted in: #Masking #Php #Redirects #Seo #Subdomain

I have a main domain: example.com and a subdomain: blog.example.com that I really want combined for SEO benefit, but my blog.example.com uses PHP which is not supported by my website provider on example.com.

I thought perhaps I could move my blog.example.com into blog.example.com/info and create a robots.txt file for blog.example.com to tell search engines to not index the subdomain and then create example.com/blog as a masking redirect to blog.example.com/info. Will this cause the blog to only be indexed once by search engines and make it appear as if the blog (PHP) site is hosted under the main domain?

If not, is there another approach I could take here instead? The goal is to have the blog SEO attributed to the main domain whose hosting does not permit PHP.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Michele947

3 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

...create example.com/blog as a masking redirect to ...


Yes, in theory, you can do exactly that. Note that by "masking redirect" we are not talking about "framed forwarding" or similar (which won't help at all). The "redirect" is completely "masked" from the user. The address in the browser's address bar shows example.com/blog but the server actually retrieves the content from blog.example.com/ (an additional / proxied request).

On Apache you can use mod_proxy (and optionally mod_rewrite) to proxy the request from example.com/blog to blog.example.com (a reverse proxy). However, if your current host is too restrictive (after all, it doesn't support PHP?) then this might not be possible. This is likely to require some additional config on your blog, since the base URL is now example.com/blog and not blog.example.com/.


move my blog.example.com into blog.example.com/info


Not sure why you would want to do this seemingly "additional" step? (Why /info?) You don't need to move your blog anywhere. example.com/blog would go straight to blog.example.com.


create a robots.txt file for blog.example.com to tell search engines to not index the subdomain.


You definitely must not do this! If you suddenly block the search engines from crawling the old URLs then bang goes your SEO! You will essentially be starting from scratch. Moving from blog.example.com to example.com/blog is a URL change/migration. Like any URL change you would need to setup 301 (permanent) redirects from the old to new URLs - this allows search engines to discover the new URLs where the old URLs have already been indexed. And like any URL change you might experience a dip in ranking initially. There is always a risk.

So, the basic steps involved would be:


Proxy all the requests from example.com/blog/ to blog.example.com/.
Change all your internal links to your new blog URL.
Setup external (301) redirects from the old to new URLs. ie. blog.example.com/ to example.com/blog/.


However, I'm not convinced that "changing" the existing URL structure is going to be "worth it". As mentioned above, there is always a risk in changing the URL structure and having the blog under the same host (as opposed to a separate subdomain) may not see the SEO advantage you are seeking.

10% popularity Vote Up Vote Down


 

@Sims2060225

Well, Masking redirection is strictly prohibited in SEO. Better apply 301 redirection (permanent) which is suggested by Google.

I mean, move all of your contents from your blog pages to your main site. Then apply a 301 redirection to all of your pages of blog.example.com to your main domain example.com. Thats it.

What you have to keep in mind that, your blog's content url and site url structure should be same.

10% popularity Vote Up Vote Down


 

@Ogunnowo487

This is quite tricky. One possible answer (I'm curious based on you've not expressed your reasons for not doing this) why not move your website over to the host that does support PHP to centralise everything?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme