Skip to content

Instantly share code, notes, and snippets.

@nadyshalaby
Created October 20, 2021 13:06
Show Gist options
  • Save nadyshalaby/77c09e16888d21594ff38f87d7013a71 to your computer and use it in GitHub Desktop.
Save nadyshalaby/77c09e16888d21594ff38f87d7013a71 to your computer and use it in GitHub Desktop.
Laravel .htaccess to enable routing from the base
RewriteEngine on
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment