-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
47 lines (36 loc) · 953 Bytes
/
.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
44
45
46
DirectoryIndex /index.php
# Block attempts to get the config files
<Files config.ini*>
Order Allow,Deny
Deny from all
</Files>
# If rewrite isn't available, show the internal
# configuration error screen for all attempts except
# index.php (handled there)
<IfModule !mod_rewrite.c>
ErrorDocument 404 /error.php
</IfModule>
# Block direct access to all other PHP files
<Files *.php>
Order Deny,Allow
Deny from all
</Files>
<Files index.php>
Order Allow,Deny
Allow from all
</Files>
<Files error.php>
Order Allow,Deny
Allow from all
</Files>
# Rewrite rules
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Redirect index.php calls to MVC-style root URL
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule index.php(.*) /$1 [R=301,L]
# Redirect all remaining calls to index.php internally for routing
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [L,QSA,NC]
</IfModule>