URL 重写不起作用 - IIS 7
这是我们在 Win 2003 上的 IIS 6 中工作的东西,但最近我们已将服务器升级到 2008 和 IIS 7.5,但在我的一生中,我无法让本机支持的 URL 重写工作。
在网站(example.site.com)下,我设置了以下规则:
<rule name="BD">
<match url="(.*)" />
<action type="Rewrite" url="http://new.site.net.au/$1" />
<conditions>
<add input="{HTTP_HOST}" pattern="^/content/packages/" />
</conditions>
</rule>
我们有一个在(example.site.com)下运行的子应用程序,名为“Content”,例如maple。即 https://example.site.com/content/ 该子应用程序使用以下代码启动以下 html 页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<script type="text/javascript">
var query = window.location.search;
query += query == "" ? "?" : "&";
window.location = 'https://' + document.domain + '/Content/Packages/Proxy/Proxy.aspx' + query + 'key=2AB90AC2-7106-4B92-87B1-EAD87E719A48';
</script>
</head>
<body>
</body>
</html>
启动时,我得到的只是:(虽然 URL 重写甚至没有发挥作用?
描述:HTTP 404。您正在查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请检查以下 URL 并确保拼写正确。 请求的 URL:/Content/Packages/Proxy/Proxy.aspx
对此的任何帮助将不胜感激!!!!
This is something that we have had working in IIS 6 on Win 2003 but recently we have upgraded our servers to 2008 and IIS 7.5 and for the life of me I cannot get the natively supprted URL rewrite to work.
Under the website (example.site.com) I have setup the following rule:
<rule name="BD">
<match url="(.*)" />
<action type="Rewrite" url="http://new.site.net.au/$1" />
<conditions>
<add input="{HTTP_HOST}" pattern="^/content/packages/" />
</conditions>
</rule>
We have a sub application that is running under (example.site.com) called "Content" for exmaple. i.e. https://example.site.com/content/
That sub application launches the following html page with this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<script type="text/javascript">
var query = window.location.search;
query += query == "" ? "?" : "&";
window.location = 'https://' + document.domain + '/Content/Packages/Proxy/Proxy.aspx' + query + 'key=2AB90AC2-7106-4B92-87B1-EAD87E719A48';
</script>
</head>
<body>
</body>
</html>
When this is launched, all I am getting is this: (it is though the URL rewrite isn't even coming into play??
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Content/Packages/Proxy/Proxy.aspx
Any help on this would be greatly appreciated!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论