Redirections test
From SiteRay wiki
| SiteRay Test | |
|---|---|
| First appeared: | Sitescore 1.0 |
| Applies to: | All versions |
| Type: | Individual test |
| Scored: | Always |
What does it do?
Test whether the website uses client-side redirections, a unnecessary trick which prevents visitors from using the Back button (every time they try, it reloads the current page), impairs SEO and Accessibility.
Why is it important?
These type of redirections are completely unnecessary and frustrate users. They also often prevent users without JavaScript enabled from accessing pages, and search engines such as Google. An alternative form of redirection ('server side') can be used without any of the side effects.
Example results
How is it measured?
Sitescore checks each page in turn for the use of certain Javascript or Meta tags which perform these redirections. The score is penalised heavily for client-side redirection in the site, proportional to the size of the website. Redirections on the homepage incur a special additional penalty as they are extraordinarily bad (and surprisingly common).
Technical explanation
Sitescore checks for use of the Meta Refresh tag, or the use of Javascript fragments extended from:
location.href location.replace window.location
How to improve this score
Replace all client-side redirections with server-side redirections. This is a technical process that generally requires a web programmer. In our experience, the biggest problem detected by this test are websites which redirect from their domain name (e.g. www.example.com) to another page (www.example.com/content/home) through client-side means. If accomplished through JavaScript, this is possibly the single worst thing that can be done to a website – it makes it inaccessible, totally cripples its search engine placement and exists only through sheer laziness of the developer. A server side redirect equivalent would be between 2-4 lines of code in almost any language (ASP / PHP / JSP). Where more complex conditions are evaluated (e.g. determining screen size via JavaScript), there should always be a link-based alternative for users without JavaScript and for search engines.
Shortcomings
Sitescore cannot possibly simulate the actual execution of the JavaScript that would go on every webpage (this is fundamentally impossible). Accordingly, it is vulnerable to some false positives and negatives, such as:
- Client is redirected via JavaScript following a user requested condition e.g. clicking in a drop-down menu. Generally such JavaScript is not recommended, but it can sometimes fire as a false positive.
- Redirection is obfuscated by exceptional methods JavaScript can be concealed through layers of encrypted
evalstatements, and other trickery. Such methods are impossible to detect.
How to use this test effectively
Ensure that client side redirections are never used on your website.
