-
Notifications
You must be signed in to change notification settings - Fork 10
/
.htaccess
78 lines (67 loc) · 2.64 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# presuponemos que en el fichero de configuracion httpd.conf tenemos
# AllowOverride All
AddDefaultCharset UTF-8
Options -Indexes +SymLinksIfOwnerMatch +Includes +ExecCGI
DirectoryIndex index.php index.html
# control de acceso. En principio se deja entrar desde cualquier IP
# en www.agilitycontest.es hay que meter filtros de bots y similares
<IfModule authz_core_module>
# Apache 2.4
Require all granted
</IfModule>
# obsoleto, pero se deja por compatibilidad
<IfModule !authz_core_module>
# Apache 2.2
Order allow,deny
Allow from all
</IfModule>
# Uncomment on master server
#<IfModule ssl_module>
# SSLVerifyClient optional
# SSLVerifyDepth 3
# # export certificate data to php files
# <FilesMatch "\.php$">
# SSLOptions +StdEnvVars +ExportCertData
# </FilesMatch>
#</IfModule>
# Configuracion de php5
<IfModule php5_module>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
# php_admin_flag allow_url_fopen Off
php_value include_path .
</IfModule>
# reglas de re-escritura y control de acceso a la aplicacion
<IfModule rewrite_module>
RewriteEngine On
# Redirect http to https:
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# to maintain compatibility with 3.7.3 server requests
# need to rewrite "server/database/updater" to "ajax"
RewriteCond %{REQUEST_URI} /server/database/updater/updateRequest.php
RewriteRule ^(.*)$ /ajax/serverRequest.php [R=307,L]
# IMPORTANT:
# in master server install, remove chrono related lines
# and add "server" to list of forbidden directories
# let the Galican Chrono work using old URL
# Current chrono firmware does not handle redirect, so need to patch a fake url
# until chrono firmware gets properly updated
RewriteCond %{REQUEST_URI} /server/database/eventFunctions.php
RewriteRule ^(.*)$ - [L]
RewriteCond %{REQUEST_URI} /server/database/sessionFunctions.php
RewriteRule ^(.*)$ - [L]
# block access to critical directories and web directory
# "server" should also be blocked, but due to above rule cannot.
# This is a security risk to be fixed asap
RewriteCond %{REQUEST_URI} /(config|applications|build|extras|logs|xampp)/
RewriteRule ^(.*) - [F,L]
# block access to critical files:
RewriteCond %{REQUEST_URI} \.(htaccess|ini|info|log|conf|sql|pem)$
RewriteRule (.*)$ - [F,L]
# Redirect base to base/agility, unless already specified
RewriteCond %{REQUEST_URI} !^/__AC_WEBNAME__\/agility/
RewriteRule ^(.*)$ /__AC_WEBNAME__/agility/$1 [R=307,L]
</IfModule>