TIP 80 Don't redirect visitors without notificationDo not redirect users, for instance 5 seconds on page entry, with a meta refresh command, without telling them it is about to happen. Also, when a timed response is required, the user should be alerted and given sufficient time to complete the action required on the page. The following is a typical meta refresh technique: <HEAD>
Whatever you do - Do Not Use This method unless specifically for security purposes! Explanation Web pages can be designed with scripts so that the web page disappears or "expires" if a response is not received within a specified amount of time. Sometimes, this technique is used for security reasons or to reduce the demands on the computer serving the web pages. A disability can have a direct impact on the speed with which a person can read, move around, or fill in a web form. Warning This is a technique often used by spammers to trick search engines and it should be avoided, unless the page is in a section of your site that isn't spidered. What the search engine spammers do is to create a page that is optimised for certain keywords and phrases - it usually has no real content. The page is then picked up by some search engines, but when a visitor clicks on the search engine entry, they are redirected to another site, often unrelated. It's a despicable trick, but thankfully most search engines have filters to detect this. Using this form of SE deception will see a site eventually banned or penalized by major players such as Google. Use Server Side redirects for old pages or moving content. But for heaven's sake, make sure they are search engine friendly! For instance: 301 RedirectsWhenever you want to move or change your domain to something else you should always use a 301 Redirect. 301 Redirects are included as part of the HTTP header information sent to the browser or requesting client. The 301 informs the requesting client that the site or resource being requested has been permanently moved. It is best to include this information for search engines in order to prevent a negative impact on your search engine ranking. For example, say I have two domains, somedomain.com and someotherdomain.com, and both these domains point to the same content. Some engines consider multiple domains pointing to the same spamming their engine and this could adversely affect your ranking on that engine. Another issue is if you want to do a branding change and as part of the new brand change the domain name. It is not simply a manner of submitting the new domain to the search engines and expecting your new domain to be indexed in the search results. If your old domain exists in their index with identical content, then most likely the search engines will ignore your submission. In addition, many of the major search engines consider posting multiple domains with the same content "spamming", and it could negatively affect your site's ranking. Bring 301 redirects to the rescue. As mentioned the 301 code sent in the header information informs the search engine that you no longer want the requested domain to be the focus, it tells them that you moved your site to a new domain. It's kind of like filling out a change of address form at the post office where yes, you'll still get mail to the old address, but the post office knows to forward it on to your new address. Eventually all mail will go to the new address and the old address is no longer associated with your mail. This is what we want to do with our old domains, let them know we moved. By doing this you can avoid confusion with search results, and limit the adverse affects on your site's ranking with the new domain name. 301 Redirects via IISOne way of accomplishing this is to use IIS and letting it know that the domain has moved. Simply go to the old site and instead of pointing to a folder location for your site, change it to do a permanent redirect for the resource. You can use the following directions to accomplish this in IIS:
301 Redirects via CodeMany people use an ISP to host their sites and may not have access to the Web server settings. The following code will provide you with how to redirect using server-side code via ASP.Net. There are many ways you can accomplish this, you could intercept the request via a HTTP handler, but in this example we'll simply provide a method at a file level in the Page_Load event. C# <script runat="server">
In VB.Net Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
You can also perform a redirect for your entire domain via code, by first checking the domain of the request, if the domain does not match the domain that you want to be the primary, then send a 301 redirect and redirect them to the appropriate file and domain. This could be done either in the global.asax or via a HTTP handler. Remember, in order to perform a redirect, the requested file will need to be processed by the ASPNet_ISAPI.dll, this means by default they're either aspx files. You can change this setting via IIS if you need to, but if you have that ability then you can change the 301 error at a server level. Redirect Your Legacy ASP FilesNow to complete this article, many of you may be porting ASP files over to ASP.Net. Let's provide some code to let the search engines know that your site should be redirect <%@ Language=VBScript %>
So you may be asking yourself, "That seems like a lot of effort, can't I just use response.redirect("http://www.somedmoain.com") and redirect the client that way?" Response.redirect is great for moving to another page within your application, but they do not send the 301 header which informs a client that this is a permanent change for the requested resource. Redirect Using a .htaccess fileCreate a .htaccess file (if does not exists) in your root directory. Careful! Your old document must be a relative link, not absolute. redirect 301 /yourdocument.htm http://www.newsite.com/yournewdocument.htm
|
The most popular pages in the Hobo Accessibility 101 Archive (by visit).
Hobo primarily operates in the following areas;
Telephone 0845 094 0839
FAX 0845 868 8946