It was recently brought to my attention about my site's terrible URL structure......and I agree. It is something I have been meaning to correct since I started the site. Later I procrastinated out of fear of losing what I have. I wrote a system to make hard copies of all of my dynamic pages. I have the room and it only updates when the page is edited. A little disk space is worth the mysql lag some of my large categories have. This works well and the database lag is removed. I just have a fear of initiating it due to SERPS loss, So can you please advise on What would be the best way to redirect a large dynamic site so no negative effects are felt? Would the proper way be for me to insert code into the dynamic pages header? I concatenate the category and title of the page and append it to "http://www.new-url.com/" the same way the files are created and then redirect via the header. Is this Google Friendly? <? if($_SERVER['QUERY_STRING']){ $NewPath = str_replace (" ", "-", $PageCategory).'/'.str_replace (" ", "-", $PageTitle).'php'; header( "HTTP/1.1 301 Moved Permanently" ); header( "Status: 301 Moved Permanently" ); header( "Location: http://www.new-url.com/{$NewPath}"); exit(0); } ?>
I have heard this but not sure how I would pull the information that I need for the redirect. I understand the pattern matching Certainly I cannot post 145,000 rules though ?
You best bet is to do as you suggested and dynamically redirect each page. A mod_rewrite script would not be possible if you need to pull info from a database to get the proper destination page. I would also do one of the following, to reduce the normal load on the server. Either use a front-end caching systems, so that once a page is called, it will be further called from the cache. Or, write a script to write all of the pages you need redirected to make them completely static without any database calls. This would eliminate the further RAM load you would experience with caching all of the pages.
Any 301 redirect should be google-friendly. Google doesn't really know or care if you're using .htaccess or PHP to do it.
Thanks All, it is greatly appreciated. I imagine a few test pages should be tried first to insure Google doesn't slap me.