Is Twitter Scaring Google?
Click to Play

How Much Are You Willing...
Recently the editor of the Financial Times, Lionel Barber, made a statement that most newspaper websites will be charging for content within a year. It is no secret...

Recent Articles

Creating The Perfect Website Landing Page
A recent video from the Google Analytics Teams is a must watch if you're trying to put together the perfect landing page for your website. Called "GWO in 60 Seconds", the video explains how you can...

Learning To Understand Web Analytics
Hearing the questions from so many that come to my seminars, one would think that analytics was difficult or hard to grasp. Seriously, it has caused great wonder...

How To Make Your Site Social Media Friendly
Numerous companies are losing vast amounts of revenue due to their web sites doing poorly in the search engines. Web sites that are not easy to find via...

Moving Forward In Anticipation Of Web 3.0 Strategies
We're all aware that Web 1.0 is over and we're trying to get up to speed with Web 2.0. So what's around the corner with Web 3.o? Peter Granat, CEO of Cision...

07.21.09

Correctly Using 301 Redirects For Multiple Browser Types

By Richard Hearne

Interesting case I came across yesterday. A URL which 301 redirected went to different URLs in different browsers.

First thought – the server was redirecting different UAs to different pages. But no, the redirect was exactly the same regardless of UA.

So how come different browsers ended up in different locations? In fact the Location was the problem:




The problem was that the redirect header had two Location attributes. Firefox 3.5 followed the last Location value, while Chrome followed the first. In 2 different browsers the client ended up in different locations.

The answer: Each redirect header should have only 1 Location attribute, and the value should be a fully formed URL (a value of "/" is technically incorrect).

Hopefully this might help someone else debug a redirect which sends different browsers to different pages/locations.

Comments


About the Author:
Richard Hearne is the founder of Red Cardinal, a dedicated search marketing consultancy. A frequent contributor to Google's Webmaster Group, Richard regularly advises clients on Internet marketing strategy and Search Engine optimisation campaigns. Richard's thoughts and research can be found on his search marketing blog.
About TheDevWeb
TheDevWeb examines the best tools and techniques to help you keep up with all the latest trends in the fast paced world of web development. Excellence in Development Starts Here





TheDevWeb is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagementNews.com





-- TheDevWeb is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2009 iEntry, Inc. All Rights Reserved Privacy Policy Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article



Excellence in Development Starts Here TheDevWeb News Archives About Us Feedback TheDevWeb Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact