URL失去在每一个页面加载的端口号 [英] URL losing port number in every page load

查看:367
本文介绍了URL失去在每一个页面加载的端口号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前采取了一定的本地网站上的照顾。

的默认端口已被更改,并且不能再没有包含在URL中,由于技术上的原因,所以现在我使用的是某个端口的IP月底举行的网址,例如:

  100.100.100.100/website.aspx
 

不再工作(其中访问默认为80)

  100.100.100.100:81/website.aspx
 

与港口,作品。

作品,虽然我不能点击任何链接或任何东西,端口消失(新页面没有加载)。然后,我保持相同的URL,只是包括端口的IP的结束,它的工作原理一遍,直到我点击另一个链接里面它。

我有机会不断变化的每一个环节,但我想这不会是正确的做法。

我应该

如何procceed?

- -

所有的URL都已经相对的,这个问题整个问题并不适用于IE浏览器,这只是发生在其他浏览器。

/website.aspx

我说要改变每一个环节会是这样

10 / website.aspx:

 
 

不过,我真的不知道..

- -

根据要求:

 < ASP:超链接=服务器文本=链接NavigateUrl =〜/文件夹/文件夹/ p​​age.aspx/>
 

解决方案

如果你键入:

  http://1.2.3.4/website.asp
 

这相当于

  http://1.2.3.4:80/website.asp
 

如果您需要指定不同的端口,你必须明确地将其包含在URL中。

选项1 如果你的所有链接的格式为

  http://1.2.3.4/website.asp
 

您需要将其更改为

  http://1.2.3.4:10/website.asp
 

选项2

选项2是改变是相对的,而不是有这么所有链接:

  http://1.2.3.4/anotherpage.asp
 

您更改它只是

  /anotherpage.asp
 

浏览器将用于每个请求相同的IP和端口号。

选项2 preferred因为它使网站对究竟这些类型的移动强大的。

I'm currently taking care of a certain local website.

The default port has been changed, and can no longer be not included in the URL due to technical reasons, so now i'm using a certain port in the end of the IP at the URL, for example

100.100.100.100/website.aspx

no longer works (which accessed 80 by default)

100.100.100.100:81/website.aspx

with the port, works.

Works, though I can't click in any link or anything and the port vanishes (new page doesn't load). Then I keep the same URL and just include the port at the end of the IP and it works again, until I click in another link inside of it.

I have access to changing each link, but I guess that would not be the right approach.

How should I procceed ?

--[EDIT]--

All URL's are already relative, and the whole issue of this question is not applicable in IE, this only happens on other browsers.

/website.aspx

What I said about changing each link would be something like

:10/website.aspx

But I really don't know..

--[EDIT]--

As requested:

<asp:HyperLink runat="server" Text="link" NavigateUrl="~/folder/folder/page.aspx" />

解决方案

If you type:

http://1.2.3.4/website.asp

That is equivalent to

http://1.2.3.4:80/website.asp

If you need to specify a different port you must include it explicitly in the URL.

Option 1 If all your links are of the form

http://1.2.3.4/website.asp

You'll need to change them to

http://1.2.3.4:10/website.asp

Option 2

Option 2 is to change all links to be relative so instead of having:

http://1.2.3.4/anotherpage.asp

You change it to just

/anotherpage.asp

The browser will then use the same IP and port number for each request.

Option 2 is preferred since it makes sites robust against exactly these types of moves.

这篇关于URL失去在每一个页面加载的端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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