Skip to content

Instantly share code, notes, and snippets.

@matovu-ronald
Created July 31, 2020 14:49
Show Gist options
  • Save matovu-ronald/90ef74abe2f28f85055724a30a177d07 to your computer and use it in GitHub Desktop.
Save matovu-ronald/90ef74abe2f28f85055724a30a177d07 to your computer and use it in GitHub Desktop.
Stack cpanel .htaccess file for laravel application
<IfModule mod_rewrite.c>
RewriteEngine On
# Fake 404 for all files in /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^/?[^/]+$ - [R=404,L]
# Protect rewrite loop: exclude /public
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