Advertisement
ihsangamerz

Settingan Htaccess Error Ingin Bisa SSL

Jan 20th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. #web saya nolbesar.com dibuat pakai html,css,javascript,dan boostrap hosting di niagahoster
  2.  
  3. <IfModule mod_headers.c>
  4. Header set X-UA-Compatible "IE=Edge,chrome=1"
  5. # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
  6. <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
  7. Header unset X-UA-Compatible
  8. </FilesMatch>
  9. </IfModule>
  10.  
  11. <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
  12. <IfModule mod_headers.c>
  13. Header set Access-Control-Allow-Origin "*"
  14. </IfModule>
  15. </FilesMatch>
  16.  
  17. <IfModule mod_deflate.c>
  18.  
  19. # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
  20.  
  21. <IfModule mod_setenvif.c>
  22. <IfModule mod_headers.c>
  23. SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
  24. RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
  25. </IfModule>
  26. </IfModule>
  27.  
  28. # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
  29. <IfModule filter_module>
  30. FilterDeclare COMPRESS
  31. FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
  32. FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
  33. FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
  34. FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
  35. FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
  36. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
  37. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
  38. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
  39. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
  40. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
  41. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
  42. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
  43. FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
  44. FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
  45. FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
  46. FilterChain COMPRESS
  47. FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
  48. </IfModule>
  49.  
  50. <IfModule !mod_filter.c>
  51. # Legacy versions of Apache
  52. AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  53. AddOutputFilterByType DEFLATE application/javascript
  54. AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
  55. AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
  56. AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
  57. </IfModule>
  58. </IfModule>
  59.  
  60. # Block access to "hidden" directories whose names begin with a period. This
  61. # includes directories used by version control systems such as Subversion or Git.
  62. <IfModule mod_rewrite.c>
  63. RewriteRule "(^|/)\." - [F]
  64. </IfModule>
  65.  
  66. # Use UTF-8 encoding for anything served text/plain or text/html
  67. AddDefaultCharset utf-8
  68.  
  69. #expired
  70. <IfModule mod_expires.c>
  71. ExpiresActive on
  72. ExpiresDefault "access plus 1 month"
  73. ExpiresByType text/html "access plus 0 seconds"
  74. ExpiresByType text/xml "access plus 0 seconds"
  75. ExpiresByType application/xml "access plus 0 seconds"
  76. ExpiresByType application/json "access plus 0 seconds"
  77. ExpiresByType image/x-icon "access plus 1 week"
  78. ExpiresByType text/css "access plus 1 year"
  79. ExpiresByType application/javascript "access plus 1 year"
  80. <IfModule mod_headers.c>
  81. Header append Cache-Control "public"
  82. </IfModule>
  83. </IfModule>
  84.  
  85.  
  86. # Rewrite "www.example.com -> example.com"
  87.  
  88. <IfModule mod_rewrite.c>
  89. RewriteCond %{HTTPS} !=on
  90. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  91. RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
  92. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement