Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

How many 301's is too many?

5:35 pm on Jun 18, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:July 18, 2005
posts: 82
votes: 0

I've recently started to need a URL shortener service for one of my web sites. I thought about farming it all out to some other company, but realized that the domain I need to shorten URLs for is incredibly short already. So, I'm creating an in-house URL shortener. Here's how it's laid out in theory:

1. .htaccess sees an incoming request for a URL with a page name beginning with "Z" (for example, example.com/Z00101 since nothing I have begins with a capital Z, this seems like an OK flag) and 301's it to /short.php

2. short.php extracts the page code from the forwarded address and looks up the full address in the database.

3. short.php squirts out its own 301 to the final destination.

So what happens is I have two 301's.

example.com/Z00101 >301> short.php >301> example.com/original.long.page.here.php

So my questions are --

Is having TWO 301's a problem? Will the search engines understand that example.com/Z00101 == example.com/original.long.page.here.php, or will they decide that example.com/Z00101 == short.php?

Will this redirecting affect page rankings in any way?

Will this set off suspicious alarms at the search engines?
9:46 pm on June 18, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member sgt_kickaxe is a WebmasterWorld Top Contributor of All Time 5+ Year Member

joined:Apr 14, 2010
votes: 0

eBay does this all the time and as of the MayDay update is having tremendous success (400% traffic jump vs April according to 3rd party stat collecting sites).

You will lose some PR through redirects and if google isn't sure you are showing the same page to everyone you could be de-indexed. Keep it consistent.
11:48 pm on June 18, 2010 (gmt 0)


WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
votes: 236

for what it's worth, everything i have read in google references/resources, MC's blog and other places agree that multiple redirects should be avoided.

site:webmasterworld.com "chained redirects" [google.com]
12:00 am on June 19, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

That first external redirect should really be an internal rewrite instead.

That is, your RewriteRule should target the internal script filepath, and should not target a URL with domain and protocol.

Use the [L] flag, and do NOT use the [R] flag.

The script will work exactly as it does now, and any request will see only a single 301 redirect. Ensure that requests for Z are not NOT redirected from non-www to www before the rewrite. Exclude the Z path from your canonicalisation rule, because the script will do all the work.

That is, both example.com/Z0001 and www.example.com/Z0001 should access the script and be redirected by the script. There should be no prior non-www/www redirect for *those* requests.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members