Wednesday, April 18, 2007

How to tell if your website uses 301 redirects

I was at Search Engine Strategies in NYC last week so I'm in an SEO mood. It was a good conference... 90% reenforcement and 10% new stuff. Most of the people there were marketers, not technologists, which is good because they did most of the small talking for me.

One thing Search Engine Marketing people stress is using 301 redirects instead of META REFRESH or 302 "Moved temporarily" redirects. 301 and 302 are HTTP headers. Most web pages send a 200 for normal status. 404 is standard for missing page ("Help! I've lost my 404 page!"). Google and, presumably, other search engines prefer 301 redirects. Why? I guess it intuitively makes sense... they don't want to bother putting something in their index if they think it's not going to be around for awhile.

I know I've made sure both and use 301 redirects. We have a new product, in beta, though, and I wasn't sure if we coded that correctly. So I needed to check. And I realized most SES attendees probably wouldn't know how to check if their sites use 301 redirects and would have to either learn or trust their coders, so therefore I decided to blog it. It's good for marketing people to not have to rely on coders. Good for all.

You can't just "view source" of a web page to see if it's doing a 301 versus a 302, because by the time you have a web page you've already been redirected. You need something that will interrupt the process. An intermediary browser. A proxy!

In the past I've used Achilles proxy server for this. But I grimace every time I install it or suggest someone install it because it really is crappy. Free software doesn't have to be crappy. Achilles would run for a couple minutes and hang. Awful interface. But it was enough to get the job done. Barely.

Searching for Achilles today to install it on my new laptop, I found that it still hasn't been update but someone else had made a new proxy. Odysseus is the successor to Achilles. I love it-- wish it had come out years ago.

Ummm... if you are using a Mac ( and lots of marketing people do, right?) this isn't going to help you. Feel free to read on anyways. Like I could stop you anyway.

Download it (it's free). Install it. Start it... in your Windows System Tray right click on it and choose IE Settings > Odysseus. Now all your Internet Explorer requests will go through Odysseus. Right click on Odysseus again and choose Configuration. Check Intercept Reply. You can deselect Intercept Request unless you really want to click on the Ok button a lot (although that is great to leave on when use are security testing your site). Right click on Achilles one more time and select Interceptor.

Now navigate to whatever page you want to test. If you left Intercept Request checked then you'll need to click "Ok" for every pages and cookies along the way. Notice that the window title bar will say "Interceptor - REQUEST" for every item you request, and "Interceptor - REPLY" for your response from the web server. To see the status number, click on the Raw tab of a reply. The first line with be something like "HTTP/1.1 200 OK" for a normal page.

For me, I went to and got the status "HTTP/1.1 302 Moved Temporarily" as it redirected to D'oh! I immediately assigned it to a Web Developer to fix. Then as a sanity check I went to and thankfully it was "HTTP/1.1 301 Moved Permanently" to Whew!

When you are all done, just right click on Odysseus again and deselect Interceptor to turn it off to resume normal browsing.

No comments: