📜  Laravel 8 - 从 URL 中删除公共 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:09.505000             🧑  作者: Mango

代码示例3
don't remove your server.php into index.php in root 
file you should place following inside .htacess file in root


RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php80” package as the default “PHP” programming language.

  AddHandler application/x-httpd-ea-php80 .php .php8 .phtml