Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...) http://blog.slucas.fr/en/oss/calibre-opds-php-server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.1KB

  1. <IfModule mod_xsendfile.c>
  2. <Files fetch.php>
  3. XSendFile on
  4. </Files>
  5. </IfModule>
  6. ###########################################
  7. # If the notation above don't work, you can try that one
  8. # Disclaimer : I'm no apache expert it can be bad security wise :(
  9. ###########################################
  10. #XSendFile On
  11. #XSendFileAllowAbove on
  12. ###########################################
  13. # On WAMP one user had to add this line in his httpd.conf
  14. # None of the abose was working
  15. ###########################################
  16. #XSendFilePath <YourCalibrePath>
  17. <IfModule mod_rewrite.c>
  18. RewriteEngine on
  19. RewriteRule ^download/(\d*)/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&db=$2&type=epub [L]
  20. RewriteRule ^download/(\d*)/(\d*)/.*\.(.*)$ fetch.php?data=$1&db=$2&type=$3 [L]
  21. RewriteRule ^download/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&type=epub [L]
  22. RewriteRule ^download/(\d*)/.*\.(.*)$ fetch.php?data=$1&type=$2 [L]
  23. </IfModule>
  24. <IfModule mod_expires.c>
  25. ExpiresActive on
  26. # Data
  27. ExpiresByType text/xml "access plus 0 seconds"
  28. ExpiresByType application/xml "access plus 0 seconds"
  29. ExpiresByType application/json "access plus 0 seconds"
  30. ExpiresByType application/xhtml+xml "access plus 0 seconds"
  31. # Favicon (cannot be renamed)
  32. ExpiresByType image/x-icon "access plus 1 week"
  33. # Media: images
  34. ExpiresByType image/png "access plus 1 month"
  35. ExpiresByType image/jpg "access plus 1 month"
  36. ExpiresByType image/jpeg "access plus 1 month"
  37. # Webfonts
  38. ExpiresByType font/truetype "access plus 1 month"
  39. ExpiresByType font/opentype "access plus 1 month"
  40. ExpiresByType application/x-font-woff "access plus 1 month"
  41. ExpiresByType image/svg+xml "access plus 1 month"
  42. ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
  43. # CSS and JavaScript
  44. ExpiresByType text/css "access plus 1 year"
  45. ExpiresByType application/javascript "access plus 1 year"
  46. ExpiresByType text/javascript "access plus 1 year"
  47. </IfModule>
  48. ###########################################
  49. # Uncomment if you wish to protect access with a password
  50. ###########################################
  51. #<FilesMatch "\.php$">
  52. #AuthUserFile /path/to/file
  53. #AuthGroupFile /dev/null
  54. #AuthName "Acces securise"
  55. #AuthType Basic
  56. #Require valid-user
  57. #</FilesMatch>