頁面的跳轉(一)

前端有一個頁面訪問,需要在瀏覽器輸入
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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章