我有以下文件夹结构:
C:\xampp\htdocs\project
在项目文件夹中,我有一个 index.html
文件和其他文件夹,其中包含 js 文件和缩小版本的 angular
和 angular-route
.
我安装了 XAMPP 并启动了所有模块(MySQL、FileZilla、Mercury、Tomcat),只有 Apache 没有启动,抛出这些消息:
5:14:15 PM [Apache] Status change detected: stopped
5:14:15 PM [Apache] Error: Apache shutdown unexpectedly.
5:14:15 PM [Apache] This may be due to a blocked port, missing dependencies,
5:14:15 PM [Apache] improper privileges, a crash, or a shutdown by another method.
5:14:15 PM [Apache] Press the Logs button to view error logs and check
5:14:15 PM [Apache] the Windows Event Viewer for more clues
5:14:15 PM [Apache] If you need more help, copy and post this
5:14:15 PM [Apache] entire log window on the forums
我试图在浏览器中查看 index.html 文件,我使用这个 URL:http://localhost/xampp/htdocs/project/index.html但我得到一个空白页面,在控制台中显示此消息:
GET http://localhost/xampp/htdocs/project/index.html 404 (Not Found)
有什么解决办法吗?
最佳答案
您尝试导航到的 URL 不正确。它应该是 localhost/project/index.html#/
。基本上,xampp 在您的系统中设置一个服务器(apache 和其他)。您的项目文件(如 index.html)应位于 xampp\htdocs\YourFolderName
中。
浏览器将服务器定位在 localhost 中,并将在上述文件夹中搜索其中可用的任何资源。所以上述情况的 url 将是 localhost/YourFolderName/index.html#/
关于javascript - 使用 XAMPP 的 AngularJS 找不到页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44973071/