Mobile app version of vmapp.org
Login or Join
Shelley277

: Is there a way to do a site-wide 301 redirect or rel="canonical" I've got a blog running on a sub domain mirrored using this method on to a sub directory, so that the links come to my main

@Shelley277

Posted in: #301Redirect #CanonicalUrl #DuplicateContent

I've got a blog running on a sub domain mirrored using this method on to a sub directory, so that the links come to my main domain not the sub domain..

Obviously this creates duplicate content. What I was planning on doing, was to block googlebot from seeing the sub domain using robots.txt and then get it to index the sub directory.

What i would also like to do is insert 301 redirects from each of the pages as well as rel="canonical". But because this is a blog there is always new content being added so I would have to add new pages to the 301 each day and add in new rel="canonical" links into each page.

Is there a way to write with the 301 redirect & rel="canonical" that anything after the slash stays the same but the domain name itself will change?

ie.

blog.mysite.com/post1 - would automaticly be redirected to - mysite.com/blog/post1

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

1 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

For 301 redirects using .htaccess it should be easy to do what you want. You could put this in your htaccess file on blog.mysite.com

Redirect 301 / mysite.com/blog/

then blog.mysite.com/post1 - would automaticly be redirected to - mysite.com/blog/post1
However, in your case, that would prevent your proxy script from getting to your website.



You could also add canonical tags to your tumblr blog using this method ratafia.info/post/78022030/adding-rel-canonical-to-tumblr-themes However, the links would point to blog.mysite.com instead of mysite.com/blog/



Here is what I would actually do. I would point DNS for blog.mysite.com away from tumblr and make sure it redirects to your website (using the rule above). Then, on the machine that does the proxying, use /etc/hosts file to let that machine (and that machine only) map the tumblr ip to the blog.mysite.com name. Then it can still proxy everything, but everybody else on the internet (including googlebot) gets redirected to your blog.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme