-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
48 lines (43 loc) · 1.22 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
44
45
46
47
48
# ============================
# Limit access to config files
# ============================
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# ========================================
# Turn on rewrite for conditional rewrites
# ========================================
Options +FollowSymlinks
RewriteEngine on
# ================
# Add slash always
# ================
##RewriteCond %{REQUEST_FILENAME} !-f
##RewriteCond %{REQUEST_URI} ([^/]+)$
##RewriteRule (.*)$ %{REQUEST_URI}/ [L,R=301,QSA]
# =====================
# Convert to clean URLS
# =====================
RewriteCond %{QUERY_STRING} $page=(.*)|$page=(.*)&(.*)
RewriteRule ^$ %1/?%2 [L,R=301]
# =======================
# Convert from clean URLS
# =======================
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?$page=$1 [L,QSA]
# =======================
# Turn on error redirects
# =======================
#ErrorDocument 400 /404
#ErrorDocument 401 /404
#ErrorDocument 403 /404
ErrorDocument 404 /404
#ErrorDocument 405 /404
#ErrorDocument 406 /404
#ErrorDocument 409 /404
#ErrorDocument 413 /404
#ErrorDocument 414 /404
#ErrorDocument 500 /404
#ErrorDocument 501 /404