Menghilangkan Public dari URL Dengan HTACCESS di Laravel

Lankah Pertama: Ganti Nama File

Rename server.php jadi index.php di laravel root directory.

server.php
INTO
index.php

Langkah Kedua: Update .htaccess

Copy .htaccess file dan taruh di laravel root folder. update dengan code:

.htaccess

Options -MultiViews -Indexes 
RewriteEngine On
# Handle Authorization
HeaderRewriteCond %{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] # Handle Front Controller...RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^ index.php [L] RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_URI} !^/public/RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]

Links:
https://hdtuto.com/article/laravel-remove-public-from-url-using-htaccess