如何让 google 将我的链接显示为 example.com 而不是 example.com/
目前谷歌将我的网站链接显示为...
example.com/
...但是,我希望它显示为...
example.com
我确实有以下元数据
<link rel="canonical" href="http://example.com" />
...下面是我的 htaccess 文件...
IndexIgnore *
ErrorDocument 400 /error
ErrorDocument 401 /error
ErrorDocument 403 /error
ErrorDocument 404 /error
ErrorDocument 500 /error
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
RewriteRule ^(home|cv|handouts|links|contact|copyright|cv)/?$ /index.php?module=home&action=$1
RewriteRule ^(log(in|out))/?$ /index.php?module=authentication&action=$1
RewriteRule ^photos/?$ /index.php?module=gallery&action=album&album=general
RewriteRule ^gallery/?$ /index.php?module=gallery&action=album&album=general
RewriteRule ^gallery/([^/\.]+)/?$ /index.php?module=gallery&action=album&album=$1
RewriteRule ^gallery/([^/\.]+)/([^/\.]+)/?$ /index.php?module=gallery&action=album&album=$1$&page=$2
RewriteRule ^gallery/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /index.php?module=gallery&action=item&album=$1$&page=$2&item=$3
RewriteRule ^release/?$ /index.php?module=release&action=release
RewriteRule ^error/?$ /index.php?module=error&action=error
...并且htaccess 文件如上所述,我注意到访问 example.com 或 example.com/index.php 会重定向到 example.com/,这可能是问题所在?
话虽如此,以及有关如何让谷歌将我的链接显示为 example.com 而不是 example.com/ 的任何想法,
提前致谢!
Currently google shows my site link as...
example.com/
...however, I would like it to be displayed as...
example.com
I do have the following meta data
<link rel="canonical" href="http://example.com" />
...and the following is my htaccess file...
IndexIgnore *
ErrorDocument 400 /error
ErrorDocument 401 /error
ErrorDocument 403 /error
ErrorDocument 404 /error
ErrorDocument 500 /error
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
RewriteRule ^(home|cv|handouts|links|contact|copyright|cv)/?$ /index.php?module=home&action=$1
RewriteRule ^(log(in|out))/?$ /index.php?module=authentication&action=$1
RewriteRule ^photos/?$ /index.php?module=gallery&action=album&album=general
RewriteRule ^gallery/?$ /index.php?module=gallery&action=album&album=general
RewriteRule ^gallery/([^/\.]+)/?$ /index.php?module=gallery&action=album&album=$1
RewriteRule ^gallery/([^/\.]+)/([^/\.]+)/?$ /index.php?module=gallery&action=album&album=$1amp;page=$2
RewriteRule ^gallery/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /index.php?module=gallery&action=item&album=$1amp;page=$2&item=$3
RewriteRule ^release/?$ /index.php?module=release&action=release
RewriteRule ^error/?$ /index.php?module=error&action=error
... and with the htaccess file being as above, I note that visiting either example.com or example.com/index.php redirects to example.com/ which perhaps could be the problem??
With all that being said, and any ideas on how to get google to display my link as example.com NOT example.com/
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
运行 Google 搜索。 数据库中的每个网站的域名后面都有一个斜杠。唯一没有尾部斜杠的情况是当它位于路径组件之后时。路径组件尾部斜杠由每个网站的管理员决定。
将来他们可能会像 Chrome 中那样隐藏尾部斜杠,但目前您无能为力。
Run a Google Search. Every single website in their database has a trailing slash after the domain name. The only time they don't have a trailing slash is when it's after a path component. The path component trailing slash is up to each website's administrator to decide.
In the future they might hide the trailing slash like they do in Chrome but for now there's nothing you can do about.