浏览器网址栏中的网址由于网页转发而快速变化

编程入门 行业动态 更新时间:2024-10-28 18:23:29
本文介绍了浏览器网址栏中的网址由于网页转发而快速变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个VPS,IP 123.123.123.123 ,Apache在7010端口上侦听(我自己只有端口7000 ... 7020) p>

我已经通过域名提供商注册了一个域 mydomain1 ,他们提供了一个web转发:

名称TTL类型优先内容转发到 * .mydomain1 3600 A 0 212.20.xx xx http://123.123。 123.123:7010 /

它的工作原理!现在,当我在浏览器网址栏中写入 www.mydomain1 时,它会自动转到 123.123.123.123:7010/ 。

问题:浏览器网址栏仅显示 www.mydomain1 0.5秒,然后显示 http://123.123 .123.123:7010 / ,这在用户体验方面不太好。

如何保持显示 www.mydomain1 在浏览器网址栏中

我应该使用Javascript进行抄袭 history.pushState(...)?

我应该怎么做这在 .htaccess 中有一些 ReverseProxySomething ?

另一个方法?

解决方案

域名提供者从默认转发到框架只需解决问题。

唯一的缺点是这是由此产生的HTML,所以这意味着它是某种黑客...

<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Frameset // ENwww.w3/TR/xhtml1/DTD/xhtml1-frameset.dtd\"> < html xmlns =www.w3/1999/xhtml> < head> < meta http-equiv =Content-Typecontent =text / html; charset = utf-8/> < / head> < frameset frameborder =noborder =0framespacing =0> < frame src =123.123.123.123:7010/name =mainFrameid =mainFrametitle =mainFrame/> < / frameset> < noframes> < body> < a href =123.123.123.123:7010/>点击重定向< / a> < / body> < / noframes> < / html>

仍然寻找更好/更清洁的解决方案!

I have a VPS with the IP 123.123.123.123 and Apache listens there on port 7010. (I only have ports 7000 ... 7020 for myself).

I have registered a domain mydomain1 by a domain provider and they offer a "web forwarding" :

Name TTL Type Priority Content Forwards to *.mydomain1 3600 A 0 212.20.xx xx 123.123.123.123:7010/

It works! Now when I write www.mydomain1 in the browser URL bar, it automatically goes to 123.123.123.123:7010/.

Problem: the browser URL bar only displays www.mydomain1 for 0.5 seconds, and then displays 123.123.123.123:7010/ instead, which is not nice in terms of user experience.

How to keep the display www.mydomain1 in the browser URL bar?

Should I hack this with Javascript history.pushState(...)?

Should I do this in .htaccess with some ReverseProxySomething?

Another method?

解决方案

Going from "Default Forwarding" to "Framed" by the domain provider simply solved the problem.

The only drawback is that this is the resulting HTML, so this means it's some sort of hack...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "www.w3/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="www.w3/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <frameset frameborder="no" border="0" framespacing="0"> <frame src="123.123.123.123:7010/" name="mainFrame" id="mainFrame" title="mainFrame" /> </frameset> <noframes> <body> <a href="123.123.123.123:7010/">Click to be redirected</a> </body> </noframes> </html>

Still looking for a better / cleaner solution!

更多推荐

浏览器网址栏中的网址由于网页转发而快速变化

本文发布于:2023-10-31 19:28:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547056.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网址   栏中   浏览器   快速   网页

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!