内部链接-跳转到链接-从https到http的问题


internal link - jump to link - from https to http issue

我在php中做了一个主页(只能在https上看到),该页面重新链接到两个不同的内部门户网站。两个内部门户网站之一(MpcPanel)位于http url上。

示例:主页网址:https://192.168.1.100

主页的html代码没有链接到正确的wepportal(MpcPanel):

  <div align="center" class="copyright" style="width: 400px; border: thin solid #F48C13; margin:0 auto;">
    <p><a href="/cgi-bin/class/login.cgi"><strong>Accesso a MpcPanel</strong></a></p>
  <p><a href="/cgi-bin/class/login.cgi"><img src="/classpba/include/images/logo.png" alt="" width="240" height="50" longdesc="/classpba/include/images/logo.png" /></a></p>

我想去的完整url是:http://192.168.1.100/cgi-bin/class/login.cgi

图片的完整url为:http://192.168.1.100/classpba/include/images/logo.png

我不想在src=中使用完整的url,我希望有机会更改我的服务器的IP,而不必被迫手动更改主页中的IP。

你不能。一旦您在HTTPS的服务器中,任何相对链接("/img/logo.png")都将通过相同的协议到达同一服务器。如果你想更改协议,你必须在那里提供完整的URL。

你可以做的是创建一个中继页面,在"https"服务器上创建页面/ig/logo.png,这是一个连接到另一个服务器的程序,拾取图像并显示它。