html - Apache vhost:我的文件夹结构的正确设置?
问题描述
我正在开发具有以下结构的网站:
- 网站的根文件夹(此处:webshop_yamamura)
- npm 创建的 node_modules 文件夹
- 前端文件夹
- jQuery 脚本文件夹
- CSS 文件夹
- 其他用html文件填充的文件夹
- 索引.html
- 其他 html 文件
- 带有 PHP 脚本的后端文件夹
- 保密文件夹
- 对象文件夹
- 等等...
我的 httpd-vhosts.conf 看起来像这样:
<VirtualHost *:80>
DocumentRoot "D:/Programme/XAMPP/htdocs/Projekte/Webshop_Yamamura"
ServerName zmf-yamamura.local
ErrorLog "D:/Programme/XAMPP/htdocs/Projekte/Webshop_Yamamura/home/backend/logs/errorlog.log"
<Directory "D:/Programme/XAMPP/htdocs/Projekte/Webshop_Yamamura">
Require all granted
AllowOverride All
Allow from all
DirectoryIndex home/frontend/index.html
</Directory>
</VirtualHost>
每个 html 文件的头部如下所示:
<head>
<!--- Bootstrap min --->
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css">
<!--- jQuery --->
<script src="/node_modules/jquery/dist/jquery.min.js"> </script>
<!--- Popper min --->
<script src="/node_modules/@popperjs/core/dist/umd/popper.min.js"></script>
<!--- Bootstrap min js --->
<script src="/node_modules/bootstrap/dist/js/bootstrap.min.js"> </script>
<!--- Custom CSS --->
<link rel="stylesheet" href="format/format.css">
<meta charset="UTF-8">
<title>Startseite</title>
</head>
我尝试了几种设置,但要么找不到像 Bootstrap 或 jQuery 这样的 npm 插件,要么他无法打开子文件夹中的 html 文件。如果您在浏览器的地址栏中键入zmf-yamamura.local,它应该会重定向到前端文件夹中的 index.html。httpd-vhosts.conf 的正确设置是什么?我目前在 Windows 10 上使用 XAMPP 进行测试。
谢谢你,保持健康!
解决方案
推荐阅读
- python - 根据列表长度和索引检查实例属性
- sql - 如何检索所有表列、数据类型、数据长度、约束类型以及引用的列和表
- azure-active-directory - 域 *.onmicrosoft.com 中的紧急访问帐户
- wpf - WPF - 悬停时更改按钮背景颜色
- date - 在 IBM I RPG 中将数字转换为 MM/DD/YYYY 格式的日期
- android - 从 kotlin 创建复选框
- javascript - 如何修复此类型错误:无法读取未定义的属性“id”
- javascript - 强制数组中的对象到最后保留当前逻辑
- java - 管理员已添加的用户无法访问活动
- reactjs - ReactJS 分页 React Hooks