规范 URL 和 Google
As far as Google and canonical URLs go - is there any advantage to adding a 301 redirect from:
http://www.mydomain.com/index.php
to
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有指定页面名称时,默认打开的页面是“
index.html
”或“index.php
”,默认优先级为后者。所以不会有任何这样的优势。而且,这也是不需要的。对于任何其他页面(主页或“
index
”命名页面除外),如果您指定重定向标头 301,则您将通知 Google & Google其他搜索引擎将目标 URL 存储为活动的 &他们的数据库中的最新一个(不是第一个)。这就像在搜索引擎的数据库中使用最新的活动 URL 设置永久链接。然而,这将有一个巨大优势。当您指定“
http://www.mydomain.com/index.php
”时,您是在通知搜索引擎仅加载“index.php
”页面时代。但是,如果您只是向搜索引擎指定“http://www.mydomain.com/
”,则取决于 (mydomain.com
) 服务器的解释(在了解服务器的 HTAccess 规则和其他重定向规则(如果有),以向用户显示正确的文件 - 它可能是“index.php
”(第一优先级)或“index.html”
”或“index.htm
” - 尽管该正确的文件可能存在也可能不存在于该服务器的托管空间中。如果不存在正确的文件,则会显示 404 Not Found 页面。该服务器的所有者有责任在其服务器的根文件夹中保存正确的文件,以便永远不会向任何用户显示 404 Not Found 页面。
所以我想说,提及“
http://www.mydomain.com/
”而不是“http://www.mydomain.com/index.html”是一个很大的优势。 php
”。希望它有帮助。
No the default page to open when no page name is specified is either "
index.html
" or "index.php
", with the priority given to the latter by default. So there will not be any advantage as such & moreover, it's not needed.For any other page (except the Home page or the "
index
" named pages), if you specify the Redirect Header 301, then you are notifying Google & other search engines to store the target URL as the active & the latest one (not the first one), in their database. It's like setting a permalink in the databases of the search engines with your latest active URLs.There will be one big advantage, however. When you are specifying "
http://www.mydomain.com/index.php
", you are notifying search engines to load the "index.php
" page only all the times. However, if you just specify "http://www.mydomain.com/
" to the search engines, then it's upto the (mydomain.com
) server's interpretation (after understanding that server's HTAccess rules & other Redirection rules, if any) to show the user the correct file - it may be "index.php
" (first priority), or "index.html
", or "index.htm
" - although that correct file may or may not be present in that server's hosting space.If the correct file is not present, then a 404 Not Found page is shown. And it's the responsibility of the owner of that server to have the correct file in his server's root folder, so that never a 404 Not Found page is shown to any user.
So I will say that it's a big advantage mentioning "
http://www.mydomain.com/
" instead of "http://www.mydomain.com/index.php
".Hope it helps.
我不认为使用重定向有任何优势。一方面,它会增加页面的加载时间,而且谷歌还会根据速度对页面进行排名。
I don't think there's any advantage of using a redirect..for one thing, it will add loading time to your page, and Google also ranks pages according to speed.