tags:

views:

57

answers:

4

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?

A: 

of course you have to rewrite output system.
or there will be no point in URL rewriting at all

Col. Shrapnel
+2  A: 

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.

sri
+1  A: 

A 301 redirect is competely the correct behaviour in this instance because the resource has 'moved', and Google should not penalise you at all.

Ciaran McNulty
+1  A: 

I would recommend attempting to replace as many as you can using a simple clean-up process. I faced the same issue and solved the problem by...

1) Detecting requests to the old URL and issuing a 301 redirect (useful especially for external links to the page)

2) Any auto-generated URLs such as the menu were updated as the code changed to generate the friendly URL

3) For WYSIWYG I performed a clean up once across all of the content to replace old URLs with the new friendly URLs, which meant less redirects being sent to the client and no "old" style URLs being displayed in status bars.

Sohnee