-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess.dist
executable file
·77 lines (60 loc) · 2.89 KB
/
.htaccess.dist
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
AddType audio/mpeg mp3
AddType audio/ogg oga ogg
AddType font/ttf ttf
AddType font/ttf TTF
AddType font/otf otf
AddType font/otf OTF
AddType fontobject eot
AddType xml svg
AddType image/svg svg
# Enable the RewriteEngine
RewriteEngine on
RewriteCond %{REQUEST_URI} "/old-browser.html"
RewriteRule (.*) $1 [L]
RewriteCond %{REQUEST_URI} "/soundcloud-callback.html"
RewriteRule (.*) $1 [L]
RewriteBase /
# Check if this is the noredirect query string
#RewriteCond %{QUERY_STRING} (^|&)m=0(&|$)
# Set a cookie, and skip the next rule
#RewriteRule ^ - [CO=mredir:0:www.website.com]
# Check if this looks like a mobile device
# (You could add another [OR] to the second one and add in what you
# had to check, but I believe most mobile devices should send at
# least one of these headers)
RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
RewriteCond %{HTTP:Profile} !^$ [OR]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteCond %{HTTP_USER_AGENT} !macintosh [NC]
# Check if we're not already on the mobile site
RewriteCond %{REQUEST_URI} !mobile
# Can not read and write cookie in same request, must duplicate condition
#RewriteCond %{QUERY_STRING} !(^|&)m=0(&|$)
# Check to make sure we haven't set the cookie before
#RewriteCond %{HTTP_COOKIE} !^.*mredir=0.*$ [NC]
# Now redirect to the mobile site
RewriteRule ^ /mobile.html [R,L,NE]
# Remove the trailing slash from routes
DirectorySlash Off
# Map resources to release distribution
RewriteRule ^app/(.*)$ dist/release/$1 [NC,L]
RewriteRule ^assets/js/libs/(.*)$ dist/release/$1 [NC,L]
RewriteRule ^assets/audio/(.*)$ dist/release/assets/audio/$1 [NC,L]
RewriteRule ^assets/css/(.*)$ dist/release/$1 [NC,L]
RewriteRule ^zeegaapi/(.*)$ http://alpha.zeega.org/api/$1 [P]
# These conditions ensure that the file does not exist and that the current
# request URI is not the index.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
# Redirect remaining requests to the index.html file
#Redirect /index.html /comingsoon.html
RewriteRule (.*) index.html [NC,L]