1, Use Text Editor to open the following file with Administrator privilege (c:\windows\system32\drivers\etc\hosts)2. Modify the hosts file and add the line (127.0.0.1 ***************)3. Then save the change, after site, we can access our development site with ********** and then use single side on login correctly. Use the trail login account saved in excel under d:\doc\webcontent
沒明白為什麼要怎麼做
localhost/項目名 項目裡的登入模組進不去
**********/項目名 項目裡的登入模組就可以進去了 (********指上線項目網址)
回複討論(解決方案)
你想要知道什麼呢?
不明白你問的是什麼
你想要知道什麼呢?
為什麼要在 hosts檔案夾上添加
127.0.0.1 上線專案網站
就是你 到底想問什麼呢?也許天知道
是 hosts 檔案,不是檔案夾
我們知道,瀏覽器訪問網站時,先要到網域名稱伺服器(DNS)將網域名稱轉換成對應的 ip,然後再用這個 ip 去串連網站伺服器
而作業系統的 hosts 檔案可以使我們省去第一步,將常用網域名稱和 ip 的對照放入 hosts 檔案,就可加快網站的訪問速度(不訪問 DNS 伺服器)
hosts 檔案的另一個作用是:可以將並不真實存在的網域名稱放在其中,來類比真實的環境
比如 hosts 檔案中有
127.0.0.1 上線專案網站
那麼你就可以用 http://上線專案網站 來訪問本來需用 http://127.0.0.1 或 http://localhost 才能訪問到本地開發項目
就好像這的在網路上訪問一樣
估計是因為這個登入會判斷網域名稱是不是指定的網域名稱,所以需要你用HOSTS解析這個網域名稱來使用。