HTML and CSS Reference
In-Depth Information
server returns when sending that resource. HTML5 Boilerplate's .htaccess file en-
sures your server provides the right MIME type when serving content.
For example, in our Senegal music festival website, we need our Web fonts to be
understood by the browser to be a font file and not garbled text. In our HTML5 Boil-
erplate .htaccess file, the following lines make sure the server returns the correct
MIME type so browsers can do that:
AddType application/
AddType application/x-font-ttfttfttc
AddType font/opentypeotf
AddType application/x-font-woffwoff
More information on MIME types can be found on the Mozilla Developer Net-
work at
erly_Configuring_Server_MIME_Types#What_are_MIME_types.3F .
Blocking access to hidden folders
If you use a Version Control System ( VCS ) to manage your website's code, the
hidden folders used to manage versioning ( .git or .svn ) are likely to exist in your
production servers too. You do not want anyone to access these files and find any
information that could be used to hack your website. HTML5 Boilerplate prevents the
server from providing content requested of these folders within the .htaccess file,
as shown in the following code snippet:
# Block access to "hidden" directories whose
names begin with a period. This
# includes directories used by version control
systems such as Subversion or Git.
<IfModule mod_rewrite.c>
RewriteCond %{SCRIPT_FILENAME} -d
RewriteCond %{SCRIPT_FILENAME} -f
Search WWH ::

Custom Search