开发者

need help with 301 redirect and seo urls

开发者 https://www.devze.com 2022-12-29 18:57 出处:网络
Ok, i used the below to \"seoize\" my urls. It works great..the only problem is when i go to the old page it doesnt redirect to the new page.. so i have a feeling i will get two pages indexed in googl

Ok, i used the below to "seoize" my urls. It works great..the only problem is when i go to the old page it doesnt redirect to the new page.. so i have a feeling i will get two pages indexed in google... how can i just permenantly redirect the old pages eto new urls...

RewriteRule ^city/([^/]+)/([^/]+) /rate-page.php?state=$1&city=$2 [NC]

http: / / www.ra开发者_开发技巧temycommunity.com/city/Kansas/Independence

and old page = http://www.ratemycommunity.com/rate-page.php?state=Kansas&city=Independence


The problem is that the ugly url must be visible, as you need them for the rewrite. Just don't make any links to the ugly urls.

If search engines already know about the ugly urls, you can add another query parameter, say show=yes.

In the rewrite rule, ensure that you have the last parameter show=yes. If not, redirect to the nice url, which in turn will rewrite to the ugly url with the last parameter. Then, never link externally to the ugly url with the show=yes parameter.

Example:

/rate-page.php?state=Somestate&city=Somecity&show=yes

Accessing this page will show the content, but you must not make that link visible from anywhere.

/city/Somestate/Somecity

should be rewritten to /rate-page.php?state=Somestate&city=Somecity&show=yes, and

/rate-page.php?state=Somestate&city=Somecity

should be redirected to /city/Somestate/Somecity


The best thing to do is use cannonicalization, a recently introduced page tagging concept that tells Google and other crawlers what you want to be the URL of record. Check out this documentation and video by Google SEO guru Matt Cutts.

In your case, it will look like this:

<link rel="canonical" href="http://www.ratemycommunity.com/city/Kansas/Independence"/>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号