How to automatically redirect a browser

28Feb06

Have you changed your server or shifted your domain and are losing out your traffic. Here is all you have to do to redirect people from your previous site to the new one. Let us assume you want to redirect http://bothack.blogspot.com to https://bothack.wordpress.com/ Here is how redirection works:

1) You add a special line of HTML code into the header of your html file, so that it looks like this (longer lines may wrap in your browser window, though they are actually on a single line):

In the above code, you’d change ‘N’ to some other number to delay the redirect. If you changed it to 5, the redirect would be delayed for 5 seconds. The URL is up to you, of course. The above example redirects to another site entirely, while it could just redirect to ANY other URL, such as another page on the same site, or a different webserver/port on the same server. It is also a good idea to add some text to your redirecting page, such as “You will automatically be redirected to the new site in xx seconds,” so the user knows what is happening. Also, you should add a link to the new site in the text, in case the user has some antiquated browser that doesn’t support redirection. You have probably seen this on other sites. Your complete html file which redirects users to your new page will end up looking something like this. If say the site is http://bothack.blogspot.com, then anyone accessing it would automatically end up at https://bothack.wordpress.com instead.

2) But if you are like me, and dont want any delay between the redirection, you could relent to scripting your site. Just add it’s code along with the meta code.

4) So a complete example :

Click HERE to see an example of it.

Advertisements


10 Responses to “How to automatically redirect a browser”

  1. 1 Coffee

    Hmm not too spectacular this time :p … *waits for more DIY stuff*

  2. Coffee, will post DIY very soon…

  3. 3 Coffee

    Preach on, my friend, preach on! 😀

  4. 4 Meg

    Well, I found it very useful.

  5. preved ot slesarya Vasi

  6. big sausage pizza porn
    big sausage pizza porn

  7. bigsausagepizza movie
    bigsausagepizza movie

  8. dr stillmans quick weight loss diet
    dr stillmans quick weight loss diet

  9. costa rica rental cars
    costa rica rental cars

  10. I can’t put META tags or Javascript on my WordPress blog.

    Any other way?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: