Web site meant to accompany a virtual machine setup specific to ProjPad.

.htaccess 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. # Apache configuration file
  2. # httpd.apache.org/docs/2.2/mod/quickreference.html
  3. # Note .htaccess files are an overhead, this logic should be in your Apache config if possible
  4. # httpd.apache.org/docs/2.2/howto/htaccess.html
  5. # Techniques in here adapted from all over, including:
  6. # Kroc Camen: camendesign.com/.htaccess
  7. # perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
  8. # Sample .htaccess file of CMS MODx: modxcms.com
  9. ###
  10. ### If you run a webserver other than apache, consider:
  11. ### github.com/paulirish/html5-boilerplate-server-configs
  12. ###
  13. # ----------------------------------------------------------------------
  14. # Better website experience for IE users
  15. # ----------------------------------------------------------------------
  16. # Force the latest IE version, in various cases when it may fall back to IE7 mode
  17. # github.com/rails/rails/commit/123eb25#commitcomment-118920
  18. # Use ChromeFrame if it's installed for a better experience for the poor IE folk
  19. <IfModule mod_setenvif.c>
  20. <IfModule mod_headers.c>
  21. BrowserMatch MSIE ie
  22. Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
  23. </IfModule>
  24. </IfModule>
  25. <IfModule mod_headers.c>
  26. # Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
  27. # We need to inform proxies that content changes based on UA
  28. Header append Vary User-Agent
  29. # Cache control is set only if mod_headers is enabled, so that's unncessary to declare
  30. </IfModule>
  31. # ----------------------------------------------------------------------
  32. # Cross-domain AJAX requests
  33. # ----------------------------------------------------------------------
  34. # Serve cross-domain ajax requests, disabled.
  35. # enable-cors.org
  36. # code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
  37. # <IfModule mod_headers.c>
  38. # Header set Access-Control-Allow-Origin "*"
  39. # </IfModule>
  40. # ----------------------------------------------------------------------
  41. # Webfont access
  42. # ----------------------------------------------------------------------
  43. # allow access from all domains for webfonts
  44. # alternatively you could only whitelist
  45. # your subdomains like "sub.domain.com"
  46. <FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
  47. <IfModule mod_headers.c>
  48. Header set Access-Control-Allow-Origin "*"
  49. </IfModule>
  50. </FilesMatch>
  51. # ----------------------------------------------------------------------
  52. # Proper MIME type for all files
  53. # ----------------------------------------------------------------------
  54. # audio
  55. AddType audio/ogg oga ogg
  56. # video
  57. AddType video/ogg ogv
  58. AddType video/mp4 mp4
  59. AddType video/webm webm
  60. # Proper svg serving. Required for svg webfonts on iPad
  61. # twitter.com/FontSquirrel/status/14855840545
  62. AddType image/svg+xml svg svgz
  63. AddEncoding gzip svgz
  64. # webfonts
  65. AddType application/vnd.ms-fontobject eot
  66. AddType font/truetype ttf
  67. AddType font/opentype otf
  68. AddType application/x-font-woff woff
  69. # assorted types
  70. AddType image/x-icon ico
  71. AddType image/webp webp
  72. AddType text/cache-manifest appcache manifest
  73. AddType text/x-component htc
  74. AddType application/x-chrome-extension crx
  75. AddType application/x-xpinstall xpi
  76. AddType application/octet-stream safariextz
  77. # ----------------------------------------------------------------------
  78. # Allow concatenation from within specific js and css files
  79. # ----------------------------------------------------------------------
  80. # e.g. Inside of script.combined.js you could have
  81. # <!--#include file="libs/jquery-1.5.0.min.js" -->
  82. # <!--#include file="plugins/jquery.idletimer.js" -->
  83. # and they would be included into this single file
  84. # this is not in use in the boilerplate as it stands. you may
  85. # choose to name your files in this way for this advantage
  86. # or concatenate and minify them manually.
  87. # Disabled by default.
  88. # <FilesMatch "\.combined\.(js|css)$">
  89. # Options +Includes
  90. # SetOutputFilter INCLUDES
  91. # </FilesMatch>
  92. # ----------------------------------------------------------------------
  93. # gzip compression
  94. # ----------------------------------------------------------------------
  95. <IfModule mod_deflate.c>
  96. # force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
  97. <IfModule mod_setenvif.c>
  98. <IfModule mod_headers.c>
  99. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
  100. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  101. </IfModule>
  102. </IfModule>
  103. # html, txt, css, js, json, xml, htc:
  104. <IfModule filter_module>
  105. FilterDeclare COMPRESS
  106. FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
  107. FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
  108. FilterChain COMPRESS
  109. FilterProtocol COMPRESS change=yes;byteranges=no
  110. </IfModule>
  111. <IfModule !mod_filter.c>
  112. # Legacy versions of Apache
  113. AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  114. AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
  115. AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  116. </IfModule>
  117. # webfonts and svg:
  118. <FilesMatch "\.(ttf|otf|eot|svg)$" >
  119. SetOutputFilter DEFLATE
  120. </FilesMatch>
  121. </IfModule>
  122. # ----------------------------------------------------------------------
  123. # Expires headers (for better cache control)
  124. # ----------------------------------------------------------------------
  125. # these are pretty far-future expires headers
  126. # they assume you control versioning with cachebusting query params like
  127. # <script src="application.js?20100608">
  128. # additionally, consider that outdated proxies may miscache
  129. # www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
  130. # if you don't use filenames to version, lower the css and js to something like
  131. # "access plus 1 week" or so
  132. <IfModule mod_expires.c>
  133. ExpiresActive on
  134. # Perhaps better to whitelist expires rules? Perhaps.
  135. ExpiresDefault "access plus 1 month"
  136. # cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
  137. ExpiresByType text/cache-manifest "access plus 0 seconds"
  138. # your document html
  139. ExpiresByType text/html "access plus 0 seconds"
  140. # data
  141. ExpiresByType text/xml "access plus 0 seconds"
  142. ExpiresByType application/xml "access plus 0 seconds"
  143. ExpiresByType application/json "access plus 0 seconds"
  144. # rss feed
  145. ExpiresByType application/rss+xml "access plus 1 hour"
  146. # favicon (cannot be renamed)
  147. ExpiresByType image/x-icon "access plus 1 week"
  148. # media: images, video, audio
  149. ExpiresByType image/gif "access plus 1 month"
  150. ExpiresByType image/png "access plus 1 month"
  151. ExpiresByType image/jpg "access plus 1 month"
  152. ExpiresByType image/jpeg "access plus 1 month"
  153. ExpiresByType video/ogg "access plus 1 month"
  154. ExpiresByType audio/ogg "access plus 1 month"
  155. ExpiresByType video/mp4 "access plus 1 month"
  156. ExpiresByType video/webm "access plus 1 month"
  157. # htc files (css3pie)
  158. ExpiresByType text/x-component "access plus 1 month"
  159. # webfonts
  160. ExpiresByType font/truetype "access plus 1 month"
  161. ExpiresByType font/opentype "access plus 1 month"
  162. ExpiresByType application/x-font-woff "access plus 1 month"
  163. ExpiresByType image/svg+xml "access plus 1 month"
  164. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  165. # css and javascript
  166. ExpiresByType text/css "access plus 2 months"
  167. ExpiresByType application/javascript "access plus 2 months"
  168. ExpiresByType text/javascript "access plus 2 months"
  169. <IfModule mod_headers.c>
  170. Header append Cache-Control "public"
  171. </IfModule>
  172. </IfModule>
  173. # ----------------------------------------------------------------------
  174. # ETag removal
  175. # ----------------------------------------------------------------------
  176. # Since we're sending far-future expires, we don't need ETags for
  177. # static content.
  178. # developer.yahoo.com/performance/rules.html#etags
  179. FileETag None
  180. # ----------------------------------------------------------------------
  181. # Stop screen flicker in IE on CSS rollovers
  182. # ----------------------------------------------------------------------
  183. # The following directives stop screen flicker in IE on CSS rollovers - in
  184. # combination with the "ExpiresByType" rules for images (see above). If
  185. # needed, un-comment the following rules.
  186. # BrowserMatch "MSIE" brokenvary=1
  187. # BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
  188. # BrowserMatch "Opera" !brokenvary
  189. # SetEnvIf brokenvary 1 force-no-vary
  190. # ----------------------------------------------------------------------
  191. # Cookie setting from iframes
  192. # ----------------------------------------------------------------------
  193. # Allow cookies to be set from iframes (for IE only)
  194. # If needed, uncomment and specify a path or regex in the Location directive
  195. # <IfModule mod_headers.c>
  196. # <Location />
  197. # Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
  198. # </Location>
  199. # </IfModule>
  200. # ----------------------------------------------------------------------
  201. # Start rewrite engine
  202. # ----------------------------------------------------------------------
  203. # Turning on the rewrite engine is necessary for the following rules and features.
  204. <IfModule mod_rewrite.c>
  205. RewriteEngine On
  206. </IfModule>
  207. # ----------------------------------------------------------------------
  208. # Suppress or force the "www." at the beginning of URLs
  209. # ----------------------------------------------------------------------
  210. # The same content should never be available under two different URLs - especially not with and
  211. # without "www." at the beginning, since this can cause SEO problems (duplicate content).
  212. # That's why you should choose one of the alternatives and redirect the other one.
  213. # By default option 1 (no "www.") is activated. Remember: Shorter URLs are sexier.
  214. # no-www.org/faq.php?q=class_b
  215. # If you rather want to use option 2, just comment out all option 1 lines
  216. # and uncomment option 2.
  217. # IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
  218. # ----------------------------------------------------------------------
  219. # Option 1:
  220. # Rewrite "www.domain.com -> domain.com"
  221. <IfModule mod_rewrite.c>
  222. RewriteCond %{HTTPS} !=on
  223. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  224. RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
  225. </IfModule>
  226. # ----------------------------------------------------------------------
  227. # Option 2:
  228. # To rewrite "domain.com -> www.domain.com" uncomment the following lines.
  229. # Be aware that the following rule might not be a good idea if you
  230. # use "real" subdomains for certain parts of your website.
  231. # <IfModule mod_rewrite.c>
  232. # RewriteCond %{HTTPS} !=on
  233. # RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
  234. # RewriteCond %{HTTP_HOST} (.+)$ [NC]
  235. # RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
  236. # </IfModule>
  237. # ----------------------------------------------------------------------
  238. # Add/remove trailing slash to (non-file) URLs
  239. # ----------------------------------------------------------------------
  240. # Google treats URLs with and without trailing slashes separately.
  241. # Forcing a trailing slash is usually preferred, but all that's really
  242. # important is that one correctly redirects to the other.
  243. # By default option 1 (force trailing slash) is activated.
  244. # http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html
  245. # http://www.alistapart.com/articles/slashforward/
  246. # http://httpd.apache.org/docs/2.0/misc/rewriteguide.html#url Trailing Slash Problem
  247. # ----------------------------------------------------------------------
  248. # Option 1:
  249. # Rewrite "domain.com/foo -> domain.com/foo/"
  250. <IfModule mod_rewrite.c>
  251. RewriteCond %{REQUEST_FILENAME} !-f
  252. RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
  253. RewriteRule ^(.*)$ /$1/ [R=301,L]
  254. </IfModule>
  255. # ----------------------------------------------------------------------
  256. # Option 2:
  257. # Rewrite "domain.com/foo/ -> domain.com/foo"
  258. #<IfModule mod_rewrite.c>
  259. # RewriteRule ^(.*)/$ /$1 [R=301,L]
  260. #</IfModule>
  261. # ----------------------------------------------------------------------
  262. # Built-in filename-based cache busting
  263. # ----------------------------------------------------------------------
  264. # If you're not using the build script to manage your filename version revving,
  265. # you might want to consider enabling this, which will route requests for
  266. # /css/all.20110203.css to /res/all.css
  267. # To understand why this is important and a better idea than all.css?v1231,
  268. # read: github.com/paulirish/html5-boilerplate/wiki/Version-Control-with-Cachebusting
  269. # Uncomment to enable.
  270. # <IfModule mod_rewrite.c>
  271. # RewriteCond %{REQUEST_FILENAME} !-f
  272. # RewriteCond %{REQUEST_FILENAME} !-d
  273. # RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
  274. # </IfModule>
  275. # ----------------------------------------------------------------------
  276. # Prevent SSL cert warnings
  277. # ----------------------------------------------------------------------
  278. # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
  279. # https://www.domain.com when your cert only allows https://secure.domain.com
  280. # Uncomment the following lines to use this feature.
  281. # <IfModule mod_rewrite.c>
  282. # RewriteCond %{SERVER_PORT} !^443
  283. # RewriteRule (.*) https://example-domain-please-change-me.com/$1 [R=301,L]
  284. # </IfModule>
  285. # ----------------------------------------------------------------------
  286. # Prevent 404 errors for non-existing redirected folders
  287. # ----------------------------------------------------------------------
  288. # without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
  289. # e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
  290. Options -MultiViews
  291. # ----------------------------------------------------------------------
  292. # custom 404 page
  293. # ----------------------------------------------------------------------
  294. # You can add custom pages to handle 500 or 403 pretty easily, if you like.
  295. ErrorDocument 404 /404.html
  296. # ----------------------------------------------------------------------
  297. # UTF-8 encoding
  298. # ----------------------------------------------------------------------
  299. # use utf-8 encoding for anything served text/plain or text/html
  300. AddDefaultCharset utf-8
  301. # force utf-8 for a number of file formats
  302. AddCharset utf-8 .html .css .js .xml .json .rss
  303. # ----------------------------------------------------------------------
  304. # A little more security
  305. # ----------------------------------------------------------------------
  306. # Do we want to advertise the exact version number of Apache we're running?
  307. # Probably not.
  308. ## This can only be enabled if used in httpd.conf - It will not work in .htaccess
  309. # ServerTokens Prod
  310. # "-Indexes" will have Apache block users from browsing folders without a default document
  311. # Usually you should leave this activated, because you shouldn't allow everybody to surf through
  312. # every folder on your server (which includes rather private places like CMS system folders).
  313. # Options -Indexes
  314. # Block access to "hidden" directories whose names begin with a period. This
  315. # includes directories used by version control systems such as Subversion or Git.
  316. <IfModule mod_rewrite.c>
  317. RewriteRule "(^|/)\." - [F]
  318. </IfModule>
  319. # If your server is not already configured as such, the following directive
  320. # should be uncommented in order to set PHP's register_globals option to OFF.
  321. # This closes a major security hole that is abused by most XSS (cross-site
  322. # scripting) attacks. For more information: http://php.net/register_globals
  323. #
  324. # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
  325. #
  326. # Your server does not allow PHP directives to be set via .htaccess. In that
  327. # case you must make this change in your php.ini file instead. If you are
  328. # using a commercial web host, contact the administrators for assistance in
  329. # doing this. Not all servers allow local php.ini files, and they should
  330. # include all PHP configurations (not just this one), or you will effectively
  331. # reset everything to PHP defaults. Consult www.php.net for more detailed
  332. # information about setting PHP directives.
  333. # php_flag register_globals Off