-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
38 lines (31 loc) · 1.25 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
Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api$ feature.php [L]
RewriteRule ^cds/(bcmt|isgi|grenoble)/(obs|data|indices|archive).*$ /center/$1.php?%{QUERY_STRING} [L]
RewriteRule ^service/(elevation).*$ /query/$1.php?%{QUERY_STRING} [L]
RewriteRule ^api.*$ feature.php?%{QUERY_STRING} [L]
</IfModule>
ErrorDocument 404 /404.php
# Enable cross domain access control
# Header always set Access-Control-Max-Age 1728000
# Header always set Access-Control-Allow-Origin: "*"
# Header always set Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
# Header always set Access-Control-Allow-Headers: "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,C$
# Header always set Access-Control-Allow-Credentials true
<FilesMatch "\.(tif|tiff|png|xml)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
<FilesMatch "\.(json)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set Content-Type "application/json"
</IfModule>
</FilesMatch>