Created
January 3, 2023 21:10
-
-
Save wp-kitten/ff5164df5caecf8640047a3ae981fa94 to your computer and use it in GitHub Desktop.
Remove "public" from URL for Laravel websites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !^/public/ | |
RewriteRule ^(.*)$ /public/$1 [L,QSA] | |
--- | |
This will silently rewrite all your base URIs to the /public folder. | |
Even all Headers, for example the HTTP Authorization Header, and all | |
optional URI parameters will silently be passed on to the /public folder as well. | |
Applies to web hosts that do not allow to change the home directory. | |
Location: .htaccess file in the root directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment