301 redirect Blogger to another Host and keep Google rank

断了今生、忘了曾经 提交于 2019-12-02 07:00:46

If you had your domain pointed at blogger until now, and will have it pointed at your new server in the future, then all future requests will reach your new server automatically. So all you will have to do is set up the rewriting of all “old” URLs to the new targets on your new server.

With a Redirect directive as mentioned by you in comments, you should be able to achieve that. Using this technique, you will need to use a Redirect for each old URL you want to redirect to a new one.

If all of your old URLs follow the pattern of /yyyy/mm/post-name.html, and all of your new URLs are just /post-name.html with the post names being still the same, you might want to use a RewriteRule instead:

RewriteEngine On
RewriteRule ^([0-9]{4})/([0-9]{2})/(.*)$ /$3 [R=301]

This will match on all incoming requests that start with four digits (the leading slash will have been stripped off at that point already), followed by a slash, followed by two digits and another slash, and then just “anything” after that, and will redirect it to that “anything”. It will be prefixed with the protocol and server name automatically. And the [R=301] flag will make this a redirect with 301 status code.

That way, you could catch all of those old post URLs with just one rule, and would not have to write a Redirect statement for each one individually.

(If you need more information about how this works, please consult the mod_rewite documentation first.)

If you are trying to redirect one url to another domain on existing page

like http://some-domain.com/2017/abc.html to http://another-domain.com/2017/abc.html

You can use following javascript

<script>
var url = location.href;
var newurl = url.replace('some-domain.com','another-domain.com';);
location.href=newurl;

</script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!