文件到noindex标签? [英] The file to noindex tag?

查看:85
本文介绍了文件到noindex标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站上为一个单页提供noindex标签。

我知道我必须在标题中这样做。



但我应该在哪里更换标签?

如果我要更改我的标题,那么它将改变网站上的每一页。 br $>


我的网站是 Skaftekster ,我希望你们能帮助我!

我无法在HTML中更改它,但我需要找到合适的文件才能完成。



我是什么尝试过:



我已经找到了Index.html但我只有index.php而且我不可能在PHP中编写元标记。

I want to give one single page on my website a noindex tag.
I know I have to do it in the header.

But where exactly should I replace the tag?
If I will change my header then it will change every pages on the website.

My website is Skaftekster and I hope you guys can help me!
And I can't change it in the HTML, I need to find the right file to do it though.

What I have tried:

I have fried to find the Index.html but I only have index.php and it's not possible to write meta tags in PHP.

推荐答案

你说的不是真的;即使使用HTTP标头,当您更改一个标头时,也只需为一个页面更改它。当然,有服务器默认值,但最好不要依赖它们,它与您的情况无关。到目前为止,我们正在讨论与您的问题无关的内容。



您在询问noindex tag ;这是HTML 听取元标记的一部分。这里有详细描述: noindex - 维基百科,免费的百科全书 [ ^ ]。



参见:网络机器人页面 [ ^ ]。



现在,它可能不是你想要的。你说我不能在HTML中改变它。对不起,为什么?如果这是你的网站,你可以做到,如果没有,你根本就做不到。 :-)

HTML是一个正确的地方;这是一种不依赖于服务器特定功能的通用方法。



无论如何,另一个相当常见的地方是众所周知的robots.txt。您可以阅读此主题,称为机器人排除标准,例如:机器人排除标准 - 维基百科,免费的百科全书 [ ^ ]。



不幸的是,即使你可以用它来禁止索引(无论如何总是只是一个推荐),你必须只有一个文件,在你网站的根目录中,所以你不能将不同的文件放在不同的位置(除了根目录之外都会被忽略),但规则本身可以指定特定的目录。



参见:网络机器人页面 [ ^ ]。



对于某些HTTP服务器,首先是Apache,你可以使用.htaccess和/或httpd .conf fi les:

Apache HTTP Server教程:.htaccess文件 - Apache HTTP Server版本2.4 [ ^ ],

配置文件 - Apache HTTP Server版本2.4 [ ^ ]。



我认为上述对不同配置文件的引用的主要目的是说服你使用HTML head 。 :-)



-SA
What you say is not true; even with HTTP headers, when you change one header, you change it just for one page. Of course, there are server defaults, but it's better not to rely on them, and it is not relevant to your case. So far, we are discussing something unrelated to your problem.

You are asking about noindex tag; and this is a part of HTML hear, a meta tag. This is fully described here: noindex — Wikipedia, the free encyclopedia[^].

See also: The Web Robots Pages[^].

Now, it might be not what you want. You say "And I can't change it in the HTML". Excuse me, why? If this is your site, you can do it, if not, you cannot do it at all, anyway. :-)
HTML is a right place; this is a universal method which does not depend on server-specific features.

Anyway, another fairly common place is well-known robots.txt. You can read on this topic, called robots exclusion standard, for example, here: Robots exclusion standard — Wikipedia, the free encyclopedia[^].

Unfortunately, even though you can use it to disallow indexing (which is always just a recommendation anyway), you have to have only one file, in the root of your site, so you cannot put different files at different locations (they would be all ignored except the root one), but the rules themselves can specify particular directories.

See also: The Web Robots Pages[^].

For some HTTP servers, first of all, Apache, you can use .htaccess and/or httpd.conf files:
Apache HTTP Server Tutorial: .htaccess files — Apache HTTP Server Version 2.4[^],
Configuration Files — Apache HTTP Server Version 2.4[^].

I consider the main purpose of the above reference to different configuration files as the way to convince you to use HTML head. :-)

—SA


这篇关于文件到noindex标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆