Jump to content

Java Script For Bloggers


marry
 Share

Recommended Posts

Here is the code that would redirect your blog to some other blog if you want to change the URL for the old blog.This would work for blogger. I dont have any idea about all other blogging platforms. <script>var oldURL = "OLDBLOG.blogspot.com";var newURL = "NEWBLOG.blogspot.com";var url = location.href;var newURL = url.replace(document.domain,newURL);window.location = newURL</script> This code should be placed under <head> tag.

Edited by marry - outsource project
Link to comment
Share on other sites

A <meta> tag would be more effective, as it doesn't require Javascript to be enabled.

<meta http-equiv="refresh" content="0;http://example.com">

Ideally, though, you would use the server to send a redirection header and a 301 status code so that search engines know the page has moved.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...