[wp-hackers] Need ideas/approaches to a tricky 'redirect' problem...

Roy Schestowitz r at schestowitz.com
Thu Dec 8 17:03:47 GMT 2005


_____/ [David Chait] wrote : \_____
>> I'm looking for some advice on relocating (and 'splitting') CHAITGEAR
>> from
>> chait.net to chaitgear.com, and keeping/transferring pagerank of
>> course!  My
>> needs go well beyond any 'guide' or plugin I've seen, could use some
>> advice.
>> Figure I'll just point folks to the forum post I made, as it might be
>> useful
>> to others -- better to archive possible guidance there rather than
>> here in
>> the list. ;) ;)
>>
>> Post is:
>> http://wordpress.org/support/topic/51439#post-282202
>>
>> Any and all help would be much appreciated -- this is a BIG next step for
>> me, TWO years after my initial launch, and is finally going to mean my
>> shifting from a heavily-hacked 1.0a codebase to a (hopefully) mostly
>> plugin-driven 1.5.x site.  And I can 'reclaim' chait.net for my
>> coding/consulting work!  Yay! ;)
>>
>> Thanks all!
>>
>> -david

_____/ [Roy Schestowitz] wrote : \_____
> Hi David,
>
> This was probably intended to be a parent node (post) rather than a
> reply to
> Amit, but regardless:
>
> Use 301 re-directs as described below:
>
> http://www.checkupdown.com/status/E301.html
>
> You can make all posts/items in your old site send the appropriate HTTP
> header
> and 'throw' their PageRank at the new site. Use Apache's mod_rewrite if you
> want to re-direct users to corresponding pages in the new Web site.
>
> Reply to list if you prefer, but I /suspect/ it might be frowned upon by
> some
> subscribers.
>
> Roy

_____/ [David Chait] wrote : \_____
> People on the list frowning on postings?  Never! ;)


Okay, let's try...


> Actually, I'd think this a good topic given the growing number of 
> 'inadequate hosts', and that many folks start with free accounts then 
> want to migrate elsewhere.  But I'll just cobble it all together and 
> make a posting myself, so people can find it. :)


People ask these sorts of questions all the time (especially in the SEO
newsgroups) and the answer is almost the same:

-Use redirects if permitted

-If not, learn the lesson and never start a site on somebody else's turf.

You can never predict future growth. Even proper redirects typically incur the
loss of deep inbound links. On top of that, put broken bookmark links, not to
mention the loss of identity, the endless work on migration (think of sites
with >100,000 pages) and PageRank that is often leaked in the process.


> Yeah, I understand the (rudimentary) 301 stuff -- as that's what I 
> send back to referrer spammers in CG-Referrer, hoping that I'll catch 
> a few of them in their own trap.  In PHP there's certainly pretty 
> much an open book as to what I can do, but I 'suck' at 
> htaccess/mod_rewrite rules (admittedly!) and I think that is the 
> 'faster' redirect option for the most part.  I mean, I've got less 
> than a dozen articles I will likely keep on chait.net, so that's 
> probably one rule with a regex that hard-matches <12 "?p=ZZZ" post 
> IDs.


It's more fundamental than Web developer will have you believe. To
~/public_html/.htaccess, add the following:

RedirectMatch permanent ^/articles/page1 http://chaitgear.com/articles/page1

or

RedirectMatch permanent ^/index.php?p=11 http://chaitgear.com/index.php?p=11

If your site is sufficiently small, there is no need for anything too
sophisticated.


> But the trickiness of the mod_rewrites (and where I go bonkers) is 
> the complexity of the regex and the inclusion of not just a 301 
> redirect, but a 301 redirect to the NEW nice-URI format.  Now that I 
> think about it.. hmmm.


I notice that Dougal has just informed you of similar migration, from 
which you
can happily re-use.


> Will Google, et.al., follow TWO 301 redirects safely?  i.e., I do a 
> master htaccess redirect on chait.net to either chait.net/wp/?p=  or 
> chaitgear.com/?p=  (or whatever), BUT then on both I install one of 
> the "single URL only" plugins, which will do ANOTHER redirect, from 
> the p= format to the /archive/some-post-name format (which needs to 
> be php, as it has to look in the DB, or at the least in a local text 
> file -- a good optimization! -- for the proper post slug...).


I can vaguely recall something about Google disliking being bounced from place
to place. I think too many re-directions could get you penalised or simply
'nofollowed'. Dodgy sites tend(ed) to re-direct excessively.


> Did that make sense?  You know any good resources to 'dummies guide 
> to mod_rewrite'?  (All the master docs I've found got too complex too 
> quickly, and I need a really simple case or two here, it seems...)
>
> Or, maybe I just do it ALL in php, one shot, and be done with it... :) :)


Google has 871 pages of your site in cache. I think it's somewhat 
manageable for
per-item redirection. Parsing the .htaccess file would not be terrible 
either...
about 20KB? Temporarily at least.

Roy



More information about the wp-hackers mailing list