I'd say, the PHP 301 redirect is much better than the JavaScript redirect.
Lets talk about the difference:
- A (correctly) scripted 301 redirect is send as a HTTP header with no (or an empty) HTML body. That means every crawler or spider should understand it and a search engine can (and likely will) transfer the old weight (inbound links) to the new page. It also ensures the fastest transfer for every human user, that follows a link to the old page and ends up at the new page. This makes mostly sense if there is a 1:1 relationship between old pages and new pages.
- A Meta redirect (using the meat tag) is usually a bit slower because it is still loads the full HTML page. It is also not considered a permanent (301) redirect and should not transfer the link weight to the (new) destination page. Exceptions are the strategies that some search engines do use, like yahoo!, where a meta redirect with wait 0 is treated like a 301.
- A JavaScript redirect is for human consumption only. Search engine spiders and crawlers do usually only interpret the HTML part of your page. Some, like Google, try an educated guess with script code, but they do not interpret it. I have seen Google requesting additional URLs in a pattern, from JavaScript arguments that have a URL pattern. But, still it does not interpret the script.
So, if you correctly re scripted your dynamic application to redirect to the new pages, this is the one solution that will really work.
Hopefully, you have redirected every page to an equivalent page on the new site. If you just redirected all pages to your new home page, the effect will be not to great. Because, Google (and other search engines) considers the link text of your external link plus some context (words near by the link) and how they match to the content on the target page. For example, if you have a link to a specific page on the old site that talked about German Shepards and redirect it to the new German Shepard entry page, all should be fine. But if the link gets redirected to the new home page, that talks about animals and barely mentions dogs (but no German Shepards), that will NOT be as effective a link as the old one.
What you should do in addition to the redirect, is monitor your web logs and filter out all hits, that come through a direct link (referrer other than search engine or your own site). Make a statistic and contact the webmasters of sites, that have cumulative 85% of hits. Tell them exactly which link needs updating and what the exact new URL is. If you can, throw in an incentive that you link back to their site. This way you weed out all the old direct links and get the best results. Include directories in this effort.
Keep the redirect forever, as many sources can't be changed, such as mailing list archives, etc.
I hope this information helps you and others.
K<o>