如何使用 subfolder/domain 部署项目 laravel

How to deploy project laravel with subfolder/domain

我想问一下关于部署 laravel 到 apache 服务器的问题,这是 link 当它在本地 https://intranet.xxx.net.id/beranda-hc, now after deploying it becomes https://intranet.xxx.net.id/portal -hc / homepage-hc 文件时变得不可访问或您的路由问题,在将应用程序部署到服务器时有什么建议吗?我将 public 文件移动到根目录

创建 .htaccess 文件并粘贴此代码,并确保您的根文件夹中有 server.php 文件

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^ [N]
    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ server.php
</IfModule>