-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
43 lines (38 loc) · 1.52 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
35
36
37
38
39
40
41
42
43
## You should disable Indexes and MultiViews
Options -Indexes -MultiViews +FollowSymLinks
## make sure nobody gets the htaccess, README, COPYING or VERSION files
<Files ~ "^([\._]ht|README$|VERSION$|COPYING$|LICENSE$)">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
</IfModule>
</Files>
## Don't allow access to git directories
<IfModule alias_module>
RedirectMatch 404 /\.git
</IfModule>
<IfModule mod_rewrite.c>
## May be required to access sub directories.
## Not all installations will require the following line. If you do,
## change "/website" to the path to your website directory relative
## to your document root.
#RewriteBase /website
## Uncomment these rules if you want to have nice URLs
## Server must have mod_rewrite enabled:
## sudo a2enmod rewrite
## sudo service apache2 restart
RewriteEngine On
RewriteRule ^$ index.php [L]
RewriteRule (.*\.(html|md|txt|adoc))$ index.php?id=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?id=$1 [QSA,L]
RewriteRule ^index\.php$ - [L]
## HTTPS
#RewriteEngine On
#RewriteCond %{HTTPS} !on
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>