gpt4 book ai didi

html - 如何在搜索引擎中获取 http ://mysite. com/indexed,而不是 http ://mysite. com/index.php,仅此而已?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:39:25 25 4
gpt4 key购买 nike

我只想在一个搜索引擎中获得...

http://mysite.com/
indexed,not...

http://mysite.com/index.php
I only want to allow indexing of themain page of the website, and nothing more. I do not want the bot tofollow any of the links on the main page.

My meta tags include the following::

<meta name="robots" content="index, nofollow" />

我的 robot.txt 包括以下内容::

User-agent: Googlebot
Allow: /index.php
Disallow: /

User-agent: *
Disallow: /

这会达到我想要的结果吗?

提前致谢!

最佳答案

RewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.example.com/$1 [L,R=301]

将其放入 .htaccess

这直接来自 Apache's URL Rewriting Guide

关于html - 如何在搜索引擎中获取 http ://mysite. com/indexed,而不是 http ://mysite. com/index.php,仅此而已?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3765776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com