-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
54 lines (46 loc) · 1.67 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
# turn off directory browsing
IndexIgnore *
Options All -Indexes
<files "short_urls.json">
Order Allow,Deny
Deny from all
</files>
<ifmodule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# RewriteBase /
ErrorDocument 400 /index.php?e=400
ErrorDocument 401 /index.php?e=401
ErrorDocument 403 /index.php?e=403
ErrorDocument 404 /index.php?e=404
ErrorDocument 500 /index.php?e=500
RewriteRule ^sitemap\.xml$ index.php?* [L,PT]
RewriteRule ^feed/?$ feed.xml [R=303,L]
# Restrict rewriting URLs only to paths that do not actually exists
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
# Redirect to script
RewriteRule ^(.*)$ ./index.php?u=$1
</ifmodule>
<ifmodule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</ifmodule>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET"
Header set Access-Control-Allow-Headers "Content-Type"