16 Jun 2016
用户访问网站的完整功能时,即使页面发生跳转,浏览器地址栏中的URL不要发生变化。
很明显需要用HTML的frame这个tag来做,frame中的内容是加载的其他资源,它发生跳转的时候,并不会影响frame所在的静态资源界面的URL。
效果: 访问url完全不会随着你访问资源的变化而变化,只是作为一个frame访问
<html> <head> <meta http-equiv=Content-Type content="text/html;charset=GB2312" /> <title>outside.example.com</title> </head> <script LANGUAGE="JavaScript"> window.status=''; </script> <frameset rows="0,*" framespacing="0" border="0" frameborder="0"> <frame name="header" scrolling="no" noresize target="main" src=""> <frame name="main" src="http://inside.example.com" scrolling="auto"> <noframes> <body> <p></p> </body> </noframes> </frameset> </html>
server {
listen 80;
server_name outside.example.com;
index index.html;
location / {
root /data/index;
}
access_log logs/access.log access;
}