首页 > 解决方案 > Apache vhost:我的文件夹结构的正确设置?

问题描述

我正在开发具有以下结构的网站:

我的 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 进行测试。

谢谢你,保持健康!

标签: htmlapachewebservervhosts

解决方案


推荐阅读