-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
36 lines (27 loc) · 1.08 KB
/
.htaccess
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
RewriteEngine on
# Block git
RedirectMatch 404 /\.git
# ensure www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
ErrorDocument 400 "<pre> No Such File Found."
ErrorDocument 401 "<pre> No Such File Found."
ErrorDocument 404 "<pre> No Such File Found."
ErrorDocument 403 "<pre> No Such File Found."
ErrorDocument 500 "<pre> Oh No!, Its a server side error, please try again later"
ErrorDocument 502 "<pre> Oh No!, Its a server side error, please try again later"
ErrorDocument 503 "<pre> Oh No!, Its a server side error, please try again later"
ErrorDocument 504 "<pre> Oh No!, Its a server side error, please try again later"
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
# Hide the contents of directories
IndexIgnore *
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|py|pyc|.git|env)$">
Order Allow,Deny
Deny from all
</FilesMatch>