Has your group redesigned your website and moved to a new location? Renamed your organization’s name? Want to automatically redirect visitors to your web site to the new location? This week and next week’s tips will show you how.
There are basically two options to redirect visitors to your web site to a new location: the meta refresh method and the permanent redirect method. This week, we’ll show the META REFRESH method.
Redirecting using META REFRESH
NOTE: This method works best if you are only redirecting a single page to a new location.
- Open the source code of the web page you wish to redirect in a text editor.
In the HEAD section, enter the following code (substitute
numwith the desired number of seconds the browser will wait before redirecting; substitute
newlocationwith the new URL.
<meta http-equiv="refresh" content="num; url=newlocation" />
So, for example, to redirect to stanford.edu after 3 seconds:
<meta http-equiv="refresh" content="3; url=http://stanford.edu" />
You can also use the META REFRESH method without the URL to have a web page automatically reload after a certain number of seconds. Newspaper and other news-oriented web sites often do this.
For example, to automatically reload the browser every 30 minutes (1800 seconds):
<meta http-equiv="refresh" content="1800" />
Next week, we will talk about Option 2: permanent redirects!