前端有一个页面访问,需要在浏览器输入
http://mydomain.com/html/home.html 才进行访问。
为了输入 http://mydomain.com 就可以访问。
通过一个“中间页”跳转:
我在 html 目录同级建立了一个 index.html,
结构如下:
├── ...
│ └── ...
├── ...
│ └── ...
├── index.html
├── html
│ ├── xxxx.html
index 代码如下:
<html>
<head>
<title>xxxx</title>
</head>
<body>
<script type="text/javascript">
window.location.href="html/home.html";
</script>
</body>
</html>
nginx 的相关配置如下:
server {
server_name mydomain.com;
location / {
root /home/cic/cic-kite-site;
index index.html;
}
才进行访问。
这样在浏览器中输入 http://mydomain.com 就可以自动跳转到 http://mydomain.com/html/home.html