IIS 6 设置自动转发到/default.aspx
这可能是一个奇怪的问题——而且可能是重复的。我不确定如何搜索现有答案,因此如果这是重复的,我深表歉意。
我们收到客户的请求,要求他们的网站重定向访问者,以便他们的浏览器显示网址中的默认页面。
而不是这样做:
因此,他们希望它显示:
< a href="http://www.domain.com/default.aspx" rel="nofollow noreferrer">http://www.domain.com/default.aspx
IIS 6 中是否有一个设置可以应用让这种情况发生吗?
这个问题从URL中隐藏default.aspx提出了相反的问题......如何删除default.aspx。答案是在 default.aspx 代码中添加 301 重定向。这也是最好的答案吗?
如果是这样,这将解决 /default.aspx 问题。但是,我认为客户可能会要求我们对所有子文件夹也执行此操作。我们是否只需要在代码中需要的地方添加 301 重定向即可?
或者也许我们需要考虑使用这样的工具 - http://www.helicontech.com/我们可以使用 .htaccess 文件来执行我们需要的任何 301 重定向。
感谢您的任何意见!
-- 编辑 --
需要明确的是,我确实知道如何搜索现有问题,我只是不确定在这种情况下要搜索什么。
This may be a bizarre question - and it may be a duplicate. I wasn't sure how to search for an an existing answer, so if this is a duplicate, I apologize.
We have a request from a client to have their site redirect visitors so their browser displays the default page in the url.
So instead of doing this:
they want it to display:
http://www.domain.com/default.aspx
Is there a setting in IIS 6 that can be applied that would allow this to happen?
This question Hiding default.aspx from the URL is asking the opposite... how to remove the default.aspx. The answer there was to add a 301 redirect in the default.aspx code. Would that be the best answer here as well?
If so, that would fix the /default.aspx issue. However, I think the client may ask us to do this for all subfolders as well. Will we just need to add 301 redirects in the code wherever this is needed?
Or maybe we need to look into using a tool like this - http://www.helicontech.com/ where we can just use .htaccess files to do whatever 301 redirects we need.
Thanks for any input!
-- edit --
Just to be clear, I do know HOW to search for an existing question, I just wasn't sure what to search for in this case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个答案基于 IIS5.1 方法,但打开 Internet 信息服务,右键单击您的网站,选择属性,转到文档,然后单击启用默认文档,然后将“default.aspx”首先添加到列表中。
不确定这是否是您想要的,但祝您好运。
This answer is based off the IIS5.1 approach but open up Internet Information Services, right-click on your website, choose properties go to Documents and click Enable default document and add "default.aspx" first onto the list.
Not sure if thats what you were looking for, but good luck.
这是一个有点奇怪的要求。您始终可以将默认文档设置为redirect.aspx,并在该页面的加载事件中重定向到default.aspx
不确定这将如何影响搜索引擎。
This is a bit of an odd request. You could always set the default document to redirect.aspx, and in the load event of that page do a redirect to default.aspx
Not sure how this would affect search engines.