How to Easily Redirect Your Blog to a Any Domain

How to Easily Redirect Your Blog to a Any Domain


I don't know who this post is for - leeme just keep this here; Maybe you moved from example.blogspot.com to www.mynewblog.com, and now you want anyone visiting the old blog to be redirected automatically to the new one. This guide shows you how to do that using a small, simple piece of code.

Don’t worry, this is easier than it sounds. Even if you’re not a coder or web developer, just follow the steps and copy the code I provide. It works on Blogger, personal blogs, or any basic website where you can edit the HTML.

What Does a Redirect Do?

A redirect simply means: “If someone visits this page, send them to another page instead.”

For example:
If someone goes to:
https://oldblog.blogspot.com/my-post

They will be sent automatically to:
https://yournewdomain.com/my-post

Neat, right?

How to Add the Redirect Code (Doing this on blogger)

Just copy and paste one of the scripts below into the HTML of your old blog's homepage (inside the <head> or before the </body> tag). If you're using Blogger, go to Theme > Edit HTML and paste it there.

Option 1: Instant Redirect

This version sends visitors to the new site immediately, no waiting or warning message.

<script type="text/javascript">
// Replace 'https://yournewdomain.com' with your actual new domain
if (window.location.hostname !== 'yournewdomain.com') {
    window.location.href = 'https://yournewdomain.com' + window.location.pathname;
}
</script>

📌 Change 'https://yournewdomain.com' to your actual domain, like 'https://www.mynewblog.com'.

Option 2: 5-Second Delay with Message

This version shows a message saying “This blog has moved...”, and then redirects the visitor after 5 seconds.

<script type="text/javascript">
// Replace with your new domain and customize the message
var newDomain = 'https://yournewdomain.com';
var redirectMessage = 'This blog has moved to a new address. You will be redirected in 5 seconds...';

if (window.location.hostname !== 'yournewdomain.com') {
    document.write('<div style="text-align:center;padding:20px;font-family:Arial;">' + redirectMessage + '</div>');
    setTimeout(function() {
        window.location.href = newDomain + window.location.pathname;
    }, 5000); // 5 second delay
}
</script>

🎯 Again, just change 'https://yournewdomain.com' to your new domain. You can also change the message to whatever you like.

Which One Should You Use?

  • Use Option 1 if you want a fast and silent redirect.

  • Use Option 2 if you want to let your visitors know what’s happening.

In Simple Terms:

This little code checks where your blog is being visited from.
If it’s not the new domain, it automatically sends the visitor to the correct one.

You don’t need to be a web developer to use this.
Just copy, paste, and replace the placeholder with your new domain. That’s it.

Final Tip:

If you're using Blogger, always back up your template before editing, just in case. After pasting the code, save your changes and try visiting your old blog URL, it should take you to the new one right away.

Happy blogging! 😊

Please write your comments or send a webmention
Webmention Notice

This site accepts Webmentions via webmention.io/www.sdavidprince.space/webmention. You can also reply to syndicated posts, and your responses may be backfed (posted back here) via brid.gy.

What does all these mean? Read more about it. Respect this and keep mentions relevant.

Dark/Light
Font Size
A-
A+
Best Personal Blogs About Life - OnToplist.com
Translate

Explore: Navigation