Created
March 25, 2020 07:23
-
-
Save johnkingzy/3e04bfe159de6f5bc8bf9ccc2d9bec7f to your computer and use it in GitHub Desktop.
.htaccess for a Laravel project that needs to be deployed to a Shared Hosting platform
This file contains hidden or 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
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| ## | |
| ## You may need to uncomment (remove #) the following line for some hosting environments, | |
| ## if you have installed to a subdirectory, enter the name here also. | |
| ## Example: for https://site.com enter: "/", for https://site.com/something enter: "/something/" | |
| ## | |
| # RewriteBase / | |
| ## | |
| ## Uncomment following lines to force HTTPS. | |
| ## | |
| # RewriteCond %{HTTPS} off | |
| # RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] | |
| RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ | |
| RewriteRule ^(.*) - [E=BASE:%1] | |
| RewriteCond %{REQUEST_URI} !^public | |
| RewriteRule ^(.*)$ public/$1 [L] | |
| </IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment