php - 我的网站由于某种原因没有被编入索引

标签 php redirect seo

我使用 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/');
        }

我认为是在重定向中的某个地方丢失了东西。但我不知道为什么。 任何帮助,将不胜感激。

机器人.txt:

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/

相关文章:

php - 如何修复站点地图得到错误详细信息 : 1 Errors, 0 警告。?

image - 什么最适合 SEO、CSS 大小调整或缩略图生成?

php - 创建一个触发器,一旦到达设定日期就会清除条目

redirect - Laravel/Homestead Nginx SSL 重定向循环

asp.net-mvc - 如何根据角色更改 ASP.Net MVC 登录重定向?

regex - 使用 htaccess 重写搜索页面查询 URL

javascript - 具有动态异步内容的 AngularJS 元数据

javascript - Yii - 在表单提交之前检索下拉值。

php - 从 Woocommerce 中的优惠券使用中排除具有 2 个特定属性术语的变体

phpmyadmin 显示奇怪的字符(utf8)