mirror of
https://github.com/phanan/htaccess.git
synced 2018-11-08 13:39:40 +01:00
Merge branch 'lukedmor-prevent-download'
This commit is contained in:
commit
30ee04ec23
1 changed files with 9 additions and 0 deletions
|
@ -38,6 +38,7 @@ What I'm doing here is mostly collecting useful snippets from all over the inter
|
|||
- [Set PHP Variables](#set-php-variables)
|
||||
- [Custom Error Pages](#custom-error-pages)
|
||||
- [Force Downloading](#force-downloading)
|
||||
- [Prevent Downloading](#prevent-downloading)
|
||||
- [Allow Cross-Domain Fonts](#allow-cross-domain-fonts)
|
||||
- [Auto UTF-8 Encode](#auto-utf-8-encode)
|
||||
- [Switch to Another PHP Version](#switch-to-another-php-version)
|
||||
|
@ -343,6 +344,14 @@ Sometimes you want to force the browser to download some content instead of disp
|
|||
</Files>
|
||||
```
|
||||
|
||||
### Prevent Downloading
|
||||
Sometimes you want to force the browser to display some content instead of downloading it. The following snippet will help.
|
||||
``` apacheconf
|
||||
<FilesMatch "\.(tex|log|aux)$">
|
||||
Header set Content-Type text/plain
|
||||
</FilesMatch>
|
||||
```
|
||||
|
||||
### 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.
|
||||
``` apacheconf
|
||||
|
|
Loading…
Reference in a new issue