-
Notifications
You must be signed in to change notification settings - Fork 3
/
.htaccess
58 lines (49 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
DirectoryIndex index.html index.php
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
# If installed in local or under a path say /getlancer-bidding /: (otherwise, doesn't need RewriteBase)
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/client/%{REQUEST_URI} !-f
RewriteRule ^images/([a-zA-Z_]*)/([a-zA-Z_]*)/(.*)$ server/php/image.php?size=$1&model=$2&filename=$3 [NC]
RewriteRule ^api/(.*)$ server/php/Slim/public/index.php [QSA,L]
RewriteRule ^ipn/process_ipn/(.*)/(.*)/(.*)$ server/php/Slim/public/process_ipn.php?model=$1&id=$2&hash=$3 [QSA,L]
RewriteRule ^download/([a-zA-Z_]*)/([0-9]*)/(.*)$ server/php/download.php?model=$1&id=$2&filename=$3 [QSA,L]
RewriteRule ^scripts/(plugins.[a-z0-9]*.js)$ server/php/plugin.php?file=$1 [NC]
RewriteCond %{HTTP_USER_AGENT} baiduspider|facebookexternalhit/1.1|Facebot|Twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|Pinterest|Google.*snippet|/externalhit_uatext/|Slackbot|Slack-ImgProxy|Slackbot-LinkExpanding|Site\ Analyzer|SiteAnalyzerBot|Viber|Whatsapp|Telegram [NC,OR]
RewriteCond %{QUERY_STRING} _escaped_fragment_
RewriteRule ^$ server/php/Slim/public/seo.php$1 [QSA,L]
RewriteRule ^sitemap.xml server/php/Slim/public/sitemap.php [L]
RewriteRule ^$ client/ [QSA,L]
RewriteRule ^ag-admin$ client/ag-admin/index.html [QSA,L]
RewriteRule ^(styles|fonts|images|api_explorer|ag-admin|scripts)/(.*)$ client/$1/$2 [QSA,L]
RewriteRule ^favicon.ico$ client/favicon.ico [L]
RewriteRule ^apple-touch-icon(.*)$ client/apple-touch-icon$1 [L]
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ client/index.html [L]
</IfModule>
# gzip
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/javascript application/x-javascript text/css text/html
</IfModule>
# browser caching
<IfModule mod_expires.c>
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
# ExpiresByType video/x-flv "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
# special MIME type for icons
AddType image/vnd.microsoft.icon .ico
# now we have icon MIME type, we can use it
# my favicon doesn't change much
ExpiresByType image/vnd.microsoft.icon "access plus 3 months"
</IfModule>