工作wordpress UrlRewrite没有谷歌搜索的结果

时间:2015-02-12 13:42:14

标签: php wordpress .htaccess

我创建了一些代码来重写wordpress主题中页面的URL。网址重写工作正常,但似乎谷歌找不到不同的网页。

我正在使用以下代码重写网址: 的functions.php

function add_query_vars($aVars) {
    $aVars[] = "userid";
return $aVars;
}
add_filter('query_vars', 'add_query_vars');

function add_rewrite_rules($aRules) {
$aNewRules = array('user/([^/]+)/?$' => 'index.php?pagename=user&userid=$matches[1]');
$aRules = $aNewRules + $aRules;
return $aRules;
}
add_filter('rewrite_rules_array', 'add_rewrite_rules');

page.php文件

isset($wp_query->query_vars['userid'])) {
            $user = $wp_query->query_vars['userid'];

如果有人知道为什么我的网页没有出现在谷歌搜索中,我会非常感激。

1 个答案:

答案 0 :(得分:0)

您是否尝试使用Google的网站管理员工具抓取您的网站?如果您已经拥有Gail帐户,则可以使用该帐户登录。