我用http://www.auditmypc.com/xml-sitemap.asp来检查它是否被爬行。http://www.domain.com/
未被爬网http://www.domain.com/bg/
未被爬网http://www.domain.com/bg/medical/
是否释放了巨大的爬行活动
此外,出于某种原因,/bg/medical/
是否有www
也很重要。如果没有,爬行就不会再起作用了。
.htaccess文件:
RewriteEngine on
RewriteBase /
RewriteCond %{http_host} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ site/lib/router.php
router.php文件相关部分:
@list($uri,$queryString) = explode('?',$_SERVER['REQUEST_URI'],2);
$uri = trim($uri,'/');
$_GET = array();
parse_str($queryString,$_GET);
if (empty($uri)) {
header('Location: /bg/home');
die();
}
@list($first,$second,$third,$fourth) = explode('/', $uri, 4);
///////////// VARIETY OF SWITCHES HERE with stuff like that:
if(empty($second))
switch($first){
case 'bg':
redirect('/'.$first.'/home/');
case 'en':
redirect('/'.$first.'/home/');
}
我想是在重定向的某个地方,东西会丢失。但我不明白为什么。
任何帮助都将不胜感激。
机器人:
User-agent: *
Allow: /
以及
redirect
函数的定义:function redirect($url) {
header("Location: $url");
die();
}
编辑:如果这也有帮助:
Header fields
HTTP/1.1 302 Moved Temporarily
Date
Thu, 13 Jan 2011 11:02:13 GMT
Content-Length
0
Location
/bg/home
Keep-Alive
timeout=5, max=100
Connection
Keep-Alive
Content-Type
text/html
Server
Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips- rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By
PHP/5.2.11
最佳答案
我看到你的网站出现在谷歌搜索(包括主页),所以它一定是被谷歌抓取的。我不知道这个auditmypc工具,但我认为问题更可能出在这个工具上。
改用谷歌网站管理员工具:http://www.google.com/webmasters/
在那里你可以看到谷歌是否索引了你的网站。
关于php - 我的网站由于某种原因没有被编入索引,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4678808/