wordpress重写和谷歌搜索引擎优化问题

I have a custom wordpress page that I wanted to make its url SEO friendly.

So I added some code using rewrite api to convert this url:

http://example.com/page1/?id=1234 to: http://example.com/page2/1234

page1 is still there and first url still valid. page1 was not very descriptive so I though that since I'm rewriting the url I might as well rename the page too.

Everything on the website works fine, but when I recreated the sitmap xml file and resubmitted to google I was hoping google would forget the old url and start showing the new one. This was a few weeks ago and I'm still seeing old urls. Any idea how I can remove the old urls? Do I need to physically rename the page itself?

Please help.

Thanks

Since google has indexed old URLs, it will stay in their index unless you do something about it. There are two options you can handle.

  1. If you want the old urls to coexist, you can do rel="canonical" on the old URL pages. Canonical will indicate that they are same pages with different urls.

  2. Other option is doing 301 redirect. 301 indicates that the page has moved permanently and it helps search engines to carry over the SEO values of the old urls to the new ones. In due course search engines will index the new urls and old urls will go away. After a certain point in time, once you are sure that old URLs are not receiving any traffic, you can get rid of the redirect rule.