Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Possible Duplicate:
How to tell google that i have changed my website urls?

I don;t know how to ask the question but situation is this. I have the old site with a lot of content that has recently been improved, built with another technology, among other things all the URL's have been coded in a nicer way.

Old site:

example.com/1/4444/p23a.php

New site:

example.com/music/rock

The problem is that Google and other search engines already cached a lot of this content and is appearing pretty high up. If I just redeploy the site with new links, I'm afraid all the search results will be invalid. Is there a way to solve this? All pages are dynamic, so I can't go and do any batch renaming or inserting redirect code. Also, I would eventually like for the old links to phase out, but not that people get broken links in Google search.

share|improve this question

migrated from stackoverflow.com Jan 7 '12 at 17:02

This question came from our site for professional and enthusiast programmers.

marked as duplicate by John Conde Jan 7 '12 at 18:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

If you are using apache server, use .htacess redirection for your old URL's

In the htaccess file

RewriteRule OLD_URL NEW_URL [R=301,L]

By doing this, even if anyone hits your OLD URL he will be redirected ot your new URL and it is search engine optimized.

share|improve this answer
    
But all my links are dynamic. I don't even know how many are there nor how they look. Also, will the old ones eventually phase out from search results? –  Ska Jan 6 '12 at 14:43
    
If your new dynamic links follow a pattern, then you can use wildcards while specifying the redirection in htaccess, for example : example.com/1/4444/* to redirect to example.com/music/rock –  rao_555 Jan 6 '12 at 14:47