-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
22 lines (21 loc) · 889 Bytes
/
Copy path.htaccess
File metadata and controls
22 lines (21 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Shared-hosting workaround: this project's document root is the project
# root itself (not public/), so silently route every request into public/
# while keeping the URL bar clean. Laravel's own public/.htaccess then
# handles the front-controller rewrite to index.php as usual.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
# Defense in depth: block direct access to sensitive project files even if
# mod_rewrite is ever disabled, since the whole project (including .env)
# lives inside the web root on this hosting setup.
<FilesMatch "^\.env|composer\.(json|lock)|package(-lock)?\.json|artisan|\.gitignore$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
</IfModule>
</FilesMatch>