我想知道公司徽标上的链接(通常是主页)是否应该是:
- http://www.example.com
- http://www.example.com/index.html(或其他索引文件)
- /index.html(或其他索引文件)
- /(只是根)
谷歌关心还是有其他规则?
我想知道公司徽标上的链接(通常是主页)是否应该是:
谷歌关心还是有其他规则?
A 或 D。
对完整路径进行硬编码会消除灵活性 - 让 Web 服务器或应用程序配置处理默认值。
(iirc google 并不关心任何其他链接)
好吧,我想为了简单起见,它应该只是去http://www.example.com。包括 index.html 会使其依赖于 index.html 中主页的实现,但情况可能并非总是如此。另外,如果您转到某个子域,您可能不希望在单击公司徽标时被重定向到子域的主页,据我所知,应该始终将您带回主要公司主页页。
以我最谦虚的观点并归功于我对 TBL 的理解,URL 应该是识别资源,而不是生成它的技术手段:所以我反对在链接中包含“index.html”。毕竟,您试图指向该地址处的站点,并且它当前是 HTML(或者 DirectoryIndex 在 apache 服务器上设置为“索引”)这一事实是一个实现细节。
That leaves http://example.com and / to consider. I'm somewhat indifferent between the two. Is it possible the domain name where the current content is being served from will change? If it does, do I want to link to example.com or to the current domain? That's what I would be thinking about in deciding between the two.
If you're really trying to achieve proper SEO, I would think that you would rather have a logo or banner (something that's on every page to identify the website, not the page) be set as the background of a div instead of using <img>
. I usually reserve <img>
for images particular to the content on a specific page. This allows you to set the alt attribute as well which helps with SEO. As for the link, it really shouldn't matter to Google. I'm sure they've handled this on their end.
ok simply put a never link to http://www.example.com/index.html as later you might use http://www.example.com/index.php if you change hosting or site design
equally never link to http://www.example.com as this is not a url and your browser must repair it
when linking from other company sites via logo link to http://www.example.com/ note the / as this is the actual url for {default page in first folder}
or internally on same site just link to "/" as this also means {default page in first folder on this site} which will keep your links working if company name changes
also ensure that http://example.com/ 301 redirects to http://www.example.com/ {and dosn't server identical content} and if many links are already to http://www.example.com/index.html first fix all you can second move index.html to index.htm then 301 redirect /index.html to http://www.example.com/ thus ensuring everyone eventually notices the http://www.example.com/index.html is gone
without loosing hits or PR
I would and do go to /
My PHP/xHTML looks like this
<a href="<?php echo CONFIG_DIR_BASE ?>" title="Site Home">Home</a>
Relative URLs (C and D) would be resolved by clients (Google included) to absolute URLs (to B and A respectively) and therefore treated the same as their absolute counterparts. If your A permanently redirects to B, or B to A, then Google will also treat this as one resource. Google will score A+B+C+D as one page.
Whichever one URL the others eventually resolve or redirect to will be considered the 'canonical' URL.
The words contained in your canonical URL are important. As in the URLs of questions here on stackoverflow, the words should relate to the content. Therefore what you need to decide is whether or not you want the words 'index' and 'html' in the URL. I believe best practice for home pages is to have http://www.example.com/index.html
permanently redirect to http://www.example.com/
.
Of course, content is still king, and all of this is just minor tweaking compared to adding quality content.
我认为您应该将其设置为~/
IIS / ASP.NET 会自动将其转换为您的根目录。即http://www.example.com
这也非常适合在本地进行测试。在您的本地机器上,它将指向http://127.0.0.1/whateverYourPathIs,并且当它实时部署时,它将正确指向http://www.example.com