Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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. - would automaticly be redirected to -

share|improve this question

1 Answer 1

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

Redirect 301 /

then - would automaticly be redirected to - 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 However, the links would point to instead of

Here is what I would actually do. I would point DNS for 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 name. Then it can still proxy everything, but everybody else on the internet (including googlebot) gets redirected to your blog.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.