开发者

Google webmaster crawl errors when changed pages from php to html

开发者 https://www.devze.com 2023-03-23 23:35 出处:网络
For some reason the urls in one section of our site were changed from php to html some time ago. I recently setup a Google Webmaster account and noticed the \'old\' php pages (20,000 of them!) are a

For some reason the urls in one section of our site were changed from php to html some time ago.

I recently setup a Google Webmaster account and noticed the 'old' php pages (20,000 of them!) are appearing as Crawl Errors (403 Forbidden error).

Are these the 'old' urls that Google crawled still showing in the index? If so what can I do? Is the best thing to setup a 301 redirect for all these urls, however what the best way of doing this when 开发者_JAVA技巧all thats changed in the url is the file extension (the php and html files are in the same directory) - is it possible to setup a 301 to redirect one file extension ie php to html within the same directory?


To fix this you definitely want to setup 301 redirects from the old URLs to the new URLs. If you use Apache you can do this by placing a .htaccess file in your root web directory with this snippet in it:

RewriteEngine on 
RewriteBase / 
RewriteRule ^(.*).html$ $1.php [R=301,L]
0

精彩评论

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