Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

From a post on http://diveintohtml5.org/offline.html (Wayback Machine Copy)

Your cache manifest file can be located anywhere on your web server, but it must be served with the content type text/cache-manifest. If you are running an Apache-based web server, you can probably just put an AddType directive in the .htaccess file at the root of your web directory:

AddType text/cache-manifest .manifest

Where do I create the file .htaccess?

Need some more setup with apachectl ?

Thanks very much !

share|improve this question

migrated from stackoverflow.com Jun 13 '11 at 12:51

This question came from our site for professional and enthusiast programmers.

3 Answers 3

Typically, in the root directory of your application, you'll have 3 files:

  • index.html (<html manifest="app.manifest">...</html>).
    This can also be auto-generated with a server-side language such as php, jsp, Ruby ...
  • app.manifest (CACHE MANIFEST ...)
  • .htaccess (AddType text/cache-manifest .manifest)
share|improve this answer

you can add .htaccess in any directory and the .htaccess in the child directory will enjoy the precidence over .htaccess in the parent directory.

share|improve this answer

that depend on your server, if your APC server has a cpanel named mime type section, you can click it and add this mime type manually at that section. if your server only has .htaccess,normally you need edit the file and add it manually online or edit it yourself,then save it, then let the server side clear the cache,then it will works fine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.