我正在部署laravel 7到cpanel,但我得到了空白页
此.htaccess位于重定向到公用文件夹的根文件夹中
root/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<IfModule mime_module>
AddHandler application/x-httpd-alt-php74 .php .php7 .phtml
</IfModule>
public/.htaccess
此htaccess位于公用文件夹中
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
1条答案
按热度按时间chhqkbe11#
将
root/.htaccess
的代码替换为如果您的服务器需要,请将其添加到
root/.htaccess
将
public/.htaccess
的代码替换为