Various wording optimization

This commit is contained in:
An Phan 2015-02-26 22:41:40 +08:00
parent 59d270d5a0
commit 547733bea9
1 changed files with 5 additions and 4 deletions

View File

@ -251,7 +251,7 @@ RewriteRule \.(jpg|jpeg|png|gif|bmp)$ - [NC,F,L]
``` ```
### Disable Image Hotlinking for Specific Domains ### Disable Image Hotlinking for Specific Domains
Sometimes you want to disable image hotlinking from some bad guys only. The following snippet should help you with that. Sometimes you want to disable image hotlinking from some bad guys only.
``` apacheconf ``` apacheconf
RewriteEngine on RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http(s)?://(.+\.)?badsite\.com [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(.+\.)?badsite\.com [NC,OR]
@ -436,7 +436,7 @@ ErrorDocument 404 /errors/halflife3.html
``` ```
### Force Downloading ### Force Downloading
Sometimes you want to force the browser to download some content instead of displaying it. The following snippet will help. Sometimes you want to force the browser to download some content instead of displaying it.
``` apacheconf ``` apacheconf
<Files *.md> <Files *.md>
ForceType application/octet-stream ForceType application/octet-stream
@ -447,7 +447,7 @@ Sometimes you want to force the browser to download some content instead of disp
Now there is a yang to this yin: Now there is a yang to this yin:
### Prevent Downloading ### Prevent Downloading
Sometimes you want to force the browser to display some content instead of downloading it. The following snippet will help. Sometimes you want to force the browser to display some content instead of downloading it.
``` apacheconf ``` apacheconf
<FilesMatch "\.(tex|log|aux)$"> <FilesMatch "\.(tex|log|aux)$">
Header set Content-Type text/plain Header set Content-Type text/plain
@ -455,7 +455,7 @@ Sometimes you want to force the browser to display some content instead of downl
``` ```
### Allow Cross-Domain Fonts ### Allow Cross-Domain Fonts
CDN-served webfonts might not work in Firefox or IE due to [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing). The following snippet from [alrra](https://github.com/h5bp/server-configs-apache/issues/32) should make it happen. CDN-served webfonts might not work in Firefox or IE due to [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing). This snippet solves the problem.
``` apacheconf ``` apacheconf
<IfModule mod_headers.c> <IfModule mod_headers.c>
<FilesMatch "\.(eot|otf|ttc|ttf|woff|woff2)$"> <FilesMatch "\.(eot|otf|ttc|ttf|woff|woff2)$">
@ -463,6 +463,7 @@ CDN-served webfonts might not work in Firefox or IE due to [CORS](https://en.wik
</FilesMatch> </FilesMatch>
</IfModule> </IfModule>
``` ```
[Source](https://github.com/h5bp/server-configs-apache/issues/32)
### Auto UTF-8 Encode ### Auto UTF-8 Encode
Your text content should always be UTF-8 encoded, no? Your text content should always be UTF-8 encoded, no?