gog's info

<?php echo array_rand(array('web', 'dev', 'computers')); ?>

Archive for November, 2009

Google confused with 301 redirects

without comments

It has been almost I year since we launched nacional.hr. During the migration from the old content management we thoroughly went through the whole system and made sure that all the old URIs are still working. Although cool URIs don’t change sometimes you have no choice and that was the case with this site. We had to enhance some of the URIs for SEO purpose and some of them were just clashing with our URI scheme it we did not want to maintain a large list of legacy URIs in our rewrite rules.

We hooked a legacy URI “plugin” in our error controller so that checking for old URIs does not interfere with the loading times of our system unless really necessary and created 301 (permanent) redirects to our new URI scheme patted ourselves on the back an forgot all about it until recently.

While checking the access logs for some unusual traffic spikes we where getting we noticed that Google stills checks our old category URIs and follows the redirects that we have created. The most unusual things was that the URIs where checked very often. Links to our news category pages where crawled by Google a couple of times a minute during the course of couple of days. To add to the confusion the categories that are most often crawled our the ones that list articles from our print issue which get updated once a week, the ones that are updated many times a day get crawled at a regular pace.

Any ideas what could cause something like this?

Written by Goran Jurić

November 15th, 2009 at 1:30 pm

Posted in Uncategorized

Tagged with , , , , ,

Hudson and PHP Howto

without comments

After a couple of weeks of playing with phpUnderControl and reading some nice reviews of Hudson I decided to give it a try. And boy am I glad I did.

Hudson definitively won me over with its clean interface and easy to setup tasks. Even plugin installation is a breeze and you can even do it right out of the comfort of your browser.

I found a quite nice tutorial about setting up Hudson with PHP here but I had some questions marks hovering over my head during the installation so I have decided to write a more detailed installation tutorial.

If you are running a Debian flavored distribution (yes I mean Ubuntu) take a look at the tutorial, you should have Hudson working with your PHP projects in no time.

Bonus points if you integrate your Hudson installation to act as your staging server.

Written by Goran Jurić

November 6th, 2009 at 8:53 pm

Install phpUnit on Mac OSX 10.6

without comments

Here is another quick How-to so I don’t have to look it up next time.

Open up Terminal.app and enter “sudo su” and enter your password when asked (I guess you must be using an account with administrator privileges).

pear upgrade PEAR
pear channel-discover pear.phpunit.de
pear install –alldeps phpunit/PHPUnit

That’s it. phpunit binary should be in your path now.

p.s.

For some reason phpUnit that is being used by Zend Studios (6.1) does not have mbstring extension compiled and that makes it unusable for me. I guess there is a way to force PHP interpreter that is being used in the Zend Studio to run with the mbstring extension, but this is a faster approach. Hudson or phpUnderControl (whichever you like) will take care of the code coverage reports.

Written by Goran Jurić

November 2nd, 2009 at 5:08 pm

Posted in PHP

Tagged with , , ,