用IIS 7配置的Umbraco很难访问站点URL? [英] Umbraco configured with IIS 7 having hard time with the site URL?

查看:69
本文介绍了用IIS 7配置的Umbraco很难访问站点URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS上安装Umbraco时遇到问题.除了我的主页按钮,该站点正在运行.当我按下主页按钮时,URL应该是

I am having a problem with my Umbraco installation on IIS. The site is working, apart from my home button. When I push the home button, the URL should be

http:/myserver.mysite

URL代替

http:/myserver

当我键入链接时,它会为我提供主页,但是当我单击主页"按钮时,它并不会发生上述情况.

When I type in the link it serves me the home page but when I click on the Home button it wont and the scenario described above occurs.

我正在使用IIS 7和Umbraco 6.1.1.

I am using IIS 7 and Umbraco 6.1.1.

推荐答案

如果您可以使用两个主机名访问主页,但是单击主页"链接会将您带到第二个主机,则页面中的链接必须为直接引用主机名.如果是这种情况,请检查您的HTML以确保链接中没有主机名-基本,我知道,但是您必须检查.

If you are able to get to the homepage with both hostnames but then clicking on the Home link takes you to the second host, the link in the page must be referencing the hostname directly. If this is the case, check your HTML to ensure that the hostname isn't present in the link - basic I know but you have to check.

如果不是,则与Eric Herlitz在回答中所说的相反,我将确保您不要在主机名选项中进行任何设置.仅在需要控制多个根节点的主机名时,才使用hostnames选项. Umbraco将自动假定树中的第一个节点是默认站点.换句话说,如果您在Umbraco实例的根目录中有两个站点,但在IIS中只有一个主机名绑定,则Umbraco将把第一个分支用作默认站点,除非Eric Herlitz声明,您已为特定站点指定了主机名.节点.

If it isn't, contrary to what Eric Herlitz says in his answer, I would ensure that you don't have anything set in the hostnames options. I only use the hostnames option when I need to control the hostnames of multiple root nodes. Umbraco will automatically assume that the first node in the tree is the default site. In other words, if you have two sites at the root of your Umbraco instance but only one hostname bound in IIS, Umbraco will serve the first of the branches as the default site, unless as Eric Herlitz states, you have specified the hostnames for specific nodes.

相反,我将使用IIS中的设置来确保将请求路由到正确的主机名.我知道使用Eric的方法可能会更容易,但这无疑意味着用户仍然可以使用这两个主机名来访问和浏览该站点.最终,从SEO角度来看,这是一件坏事.就个人而言,我将确保对除您首选主机名之外的任何内容的任何请求都重定向到您的主机名,同时保留路径.可以通过IIS使用 UrlRewrite 2模块来完成.

Instead, I would use the settings in IIS to ensure that requests are routed to the correct hostname. I know using Eric's approach is possibly easier, but it would undoubtedly mean that users will still be able to reach and browse the site using both hostnames. Ultimately from an SEO perspective this is a bad thing. Personally, I would ensure that any requests to anything but your preferred hostname are redirected to you hostname whilst retaining the path. This can be done via IIS using the UrlRewrite 2 module.

如果您无权访问此地址,则可以使用MVC路由(

If you don't have access to this, you can use MVC routing (see here for an explanation) or the UrlRewriting module that comes shipped with Umbraco. With the latter, settings are specified in the ~/config/UrlRewriting.config file and documentation can be found here: http://www.urlrewriting.net/149/en/home.html

我个人建议您熟悉所有这些技术,因为它们可能非常强大.

I would personally recommend familiarising yourself with all these techniques as they can be quite powerful.

这篇关于用IIS 7配置的Umbraco很难访问站点URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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