A smile is the light in your window that tells others that there is a caring, sharing person inside…. basim

Prevent Blogger from Redirecting to Country-Specific Domains



Image result for ‫نطاق رابط موقعك على جوجل‬‎
في هذه الطريقة يتم ارجاع نطاق مدونتك الى دوت كوم بدل النطاق الذي اعطاه لك جوجل على حسب بلدك او موقعك الجغرافي

This country based URL redirection does mean some negative consequences to your Blogger blog. For example:
  1. The social stats – or Facebook Likes, Google +1s and Tweet counts – for your blog stories may be diluted as the URLs for the same story become different from different visitors.
  2. You will have a similar problem if you are using an external commenting platform like Disqus or Facebook Comments.
  3. Also, if canonicalization isn’t implemented properly, it may cost you some Google juice as external websites may link to your country-specific pages.
If you are not happy with the idea of Blogger redirecting your blog to a different URL, you can add the following piece of code to your Blogger template and it will always serve the .com address to your visitors irrespective of their geographic location.
Go to your blog inside the Blogger Dashboard and choose Template. Then click the “Edit HTML” button followed by “Proceed.” Next, copy-paste the following code into the template after the <head> tag.
  1. <script type="text/javascript">
  2. var blog = document.location.hostname.split(".");
  3. if (blog[blog.length - 1] != "com") {
  4. var ncr = "http://" + blog[0] + ".blogspot.com/ncr";
  5. window.location.replace(ncr + document.location.pathname);
  6. }
  7. </script>
Click the Save Template button and now your Blogger Blog will always serve with the blogspot.com URL.

 

أشترك معنا في القرآءة للجميع