How to transform a standard photograph for use with a specific colour scheme or brand imag..
The low-cost answer to keeping your CD's/DVD's clean and functional...
Using server side includes to design and code your web site allows you to keep your develo..
A few tips for using levels in flash when loading swf files, and how to set the position o..
An interesting look at the history of YouTube and how it use to look in the early days, th..
Learn how to use the Photoshop lasso tool to great effect allowin..
This tutorial will teach you some of the basics of the third part..
A very cool tutorial on one of Photoshop CS3's fancy new tools, t..
This tutorial will teach you how to create huge print resolution ..
Iam going to warn you that if youíre a web developer and you watc..
Sometimes it is necessary to redirect traffic to a new webpage or a different site altogether if you are using a new domain name to promote your site. There are a number of ways of approaching this, depending on whether search engine optimization is important to you.
Here Iím going to discuss a few of them. Itís not an exhaustive list by any means but shows some of the main ways of doing it.
Some of the methods provide an immediate redirect, others a short delay. It is important to be aware that in some cases, the search engines donít like you to redirect that way and may mark you down as a result.
This method is ideal for pure HTML sites as there is no scripting involved, however search engines can detect the redirection. It is generally recommended that you allow a short delay of maybe 5 seconds or so for the redirection, so itís best if you show a message on the page explaining to the user that this URL is no longer valid and they will shortly be redirected to the new page.
Add the following code to the <head> section of your HTML page, replacing the [new URL] with the page or URL you want to redirect to. The number immediately preceding the URL is the delay in seconds before the redirection occurs.
<meta http-equiv="refresh" content="5;url=[new URL]">
For example to redirect to a page called mynewpage.html in 10 seconds you would add:
<meta http-equiv="refresh" content="10;url=mynewpage.html">
To redirect to the www.thecodefish.com website in 5 seconds you would add:
<meta http-equiv="refresh" content="5;url=http://www.thecodefish.com">
If you donít want a delay, set the value to 0 (zero). This is generally not recommended though as your favourite search engine may penalise you.
Using ASP to control the redirect means that the redirection is placed in a server side statement and is processed before the rest of the page is rendered to the browser. In this case, itís pointless putting anything for the user to read in the HTML as the browser wonít see it. This means really that the only point of doing it this way is as an alternative to setting the browser redirect delay to 0 as in example 1, which as mentioned has some limitations in its appeal.
If you want to go ahead anyway, add the following code to the top of the page:
VB or VB.NET:
<% response.redirect(ďmyNewURLĒ) %>
<% response.redirect[ďmyNewURLĒ] %>
So to take the main example again, if you want to redirect to thecodefish site, you would add:
<% response.redirect(ďhttp://www.thecodefish.comĒ) %>
Note if youíre using c# replace the () brackets with  square brackets in the example.
In each case the submission is automated by the script but as far as Iím aware search engines donít detect the process, not yet anyway.
Whilst you donít have to, itís probably best if you place the script within the <head> section of your page.
Replace [myNewPage] with either a page name like newpage.html or a URL like http://www.thecodefish.com For example:
An additional advantage of this method is that the new page replaces the current page in the browser history so the back button will send the user to the new page rather than the redirector page.
Using a Form Submit
<form name="redirectForm" action="[myNewPage]" method="get">
Clicking A Link Programmatically
Thereís a few different ways to achieve this but this is a simple one. The problem with this method is that not all browsers support the functionality. In reality, if youíre going to use script youíre better off using one of the previous two methods.
<a id="AutoRedirect" href="http://www.thecodefish.com">Redirection Link</a>
You might want to tell your favourite search engine that you no longer want them to index this page.
If thatís the case add the following to the head section of the page:
<meta name="Robots" content="NOINDEX">
I hope youíve found this interesting and informative.
© 2009 Wipeout44.com
Send to a friend