I’m in the process of adding ‘pretty’ URLs to an existing CMS, the menu is auto generated and the new ‘pretty’ URLs are to be handled independently as a seperate module. The auto-generated menu allways has URLs that look like this index.php?menu_id=n which ofcourse we would like to see as eg. /news or /products
I’m currently at the point where I have to decide if I’m going to rewrite all output of the current system or simply put in a hook where I redirect to the ‘pretty’ URL.
To put it differently, should i connect to the database, fetch all ‘pretty’ URLs, run through the existing output from WYSIWYG’s, news modules, forums etc. and do some str_replace or other string manipulation (which I think would be a rather tedious and boring process), or should I simply hook in and throw a 301 redirecting index.php?menu_id=3 to /news will Google (or other search engines) penalize me for having 301’s in the menus?
301 is a permanent redirect, and search engines understand them. They don’t penalize you for a 301.
My recommendation – a combination of both. For pages in your control, modify the urls. For ones beyond your control (third party blogs, other websites etc) and for your own pages that are difficult, 301s should be fine.
There is a performance aspect to 301s as well, so avoid them when you can. But if you don’t have a choice, its okay.