2013-08-12 102 views
0

我打算改變我的網站網址,我不希望我的舊鏈接,他們已經索引在谷歌去,所以我想用這種方式做,我不知道關於它。htaccess 301好的seo和動態網址的重定向

我想重定向這些鏈接

http://domain.com/usa/mobiles-phones-pdas/ad/162/mobile-for-sale 
http://domain.com/usa/mobiles-phones-pdas/mobile-phones/ad/162/mobile-for-sale 
http://domain.com/usa/mobiles-phones-pdas/mobile-phones/blackberry/ad/162/mobile-for-sale 

被重定向到這個網址

http://domain.com/usa/ads-162.html 

也是該國(美國)它不會堅持那麼它可能是另一個國家,但鏈接是相同的。

所以這是最好的SEO重定向方法,以保持我的舊鏈接谷歌索引。

問候

回答

0

這應該爲你工作

RewriteRule ^([^/]+)/.+?/ad/([0-9]+).+$ /$1/ads-$2.html [R=301,L] 
+0

重定向,但在頁面的URL仍是舊的URL親愛 –

+0

@BbWay對不起,忘了重定向標誌 - 看到更新的答案 – SmokeyPHP