forked from alefesouza/laravel-vue-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess-novhosts
49 lines (39 loc) · 1.62 KB
/
.htaccess-novhosts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Use this file if you can't change the Apache's httpd-vhosts.conf
# file to direct the DocumentRoot to the ./public folder.
# Just rename this file to .htaccess and delete or rename the ./public/.htaccess file.
# Uncomment it to enable PHP 7 as default for this project (tested on HostGator)
# AddHandler application/x-httpd-php70 .php
# <IfModule mod_suphp.c>
# suPHP_ConfigPath /opt/php70/lib
# </IfModule>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
<FilesMatch ^\.>
Order allow,deny
Deny from all
</FilesMatch>
# Disallow direct access to all project folders except public
RewriteRule ^(app|bootstrap|config|database|docker|resources|routes|tests|vendor) index.php [L]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
RewriteCond %{REQUEST_URI} !(robots\.txt|\.(css|js|png|jpg|svg|woff2|woff|ttf|gif|ico))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule (.*)/(.*)$ public/$1/$2 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule (.*)$ public/$1 [L,NC]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>