Skip to content

Instantly share code, notes, and snippets.

@dirumahrafif
Last active January 1, 2025 22:41
Show Gist options
  • Select an option

  • Save dirumahrafif/7dca90b420b3592ef1518296d222bce7 to your computer and use it in GitHub Desktop.

Select an option

Save dirumahrafif/7dca90b420b3592ef1518296d222bce7 to your computer and use it in GitHub Desktop.
Upload Laravel to Shared Hosting, so we don't need to change our file index.php in public folder
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Loading PHP as if is public/ from /
RewriteRule ^$ public/index.php [L]
#Loading page as if is public/ from /
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
RewriteRule (^\.|/\.) - [F]
<FilesMatch "^(\.env\.example|artisan|package\.json|README\.md|readme\.md|composer\.json|composer\.lock|LICENSE|spark|\.env|\.gitignore|builds|phpunit\.xml\.dst|preload\.php)$">
Require all denied
</FilesMatch>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment