我有一个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!
更多推荐
浏览器网址栏中的网址由于网页转发而快速变化
发布评论