Advertisement
niammuddin

htaccess mp3 + force SSL

Apr 28th, 2018
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteBase /
  4.  
  5. RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  6. RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
  7.  
  8. RewriteCond %{HTTPS} !on
  9. RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  10.  
  11. RewriteRule sitemap.xml$ sitemap.php [L]
  12.  
  13. RewriteRule ^genre/(.*)/(.*)\/$ all_genre.php?genre_id=$1&genre_name=$2 [L]
  14.  
  15. RewriteRule ^page/(.*)\/$ page.php?page=$1 [L]
  16. #RewriteRule ^ydl/(.*)/(.*)$ do.php?sub=$1&id=$2 [L]
  17.  
  18. RewriteCond %{REQUEST_FILENAME} !-d
  19. RewriteCond %{REQUEST_FILENAME} !-f
  20. RewriteRule ^mp3/(.*)\.html$ search.php?q=$1 [QSA,L]
  21.  
  22. RewriteCond %{REQUEST_FILENAME} !-d
  23. RewriteCond %{REQUEST_FILENAME} !-f
  24. RewriteRule ^album/(.*)/(.*)\.html$ album.php?album=$1&album_slug=$2 [QSA,L]
  25.  
  26. RewriteCond %{REQUEST_FILENAME} !-d
  27. RewriteCond %{REQUEST_FILENAME} !-f
  28. RewriteRule ^artist/(.*)/(.*)\.html$ artist.php?artist=$1&artist_slug=$2 [QSA,L]
  29.  
  30. RewriteCond %{REQUEST_FILENAME} !-d
  31. RewriteCond %{REQUEST_FILENAME} !-f
  32. RewriteRule ^download/(.*)/(.*)\.html$ download.php?dl=$1&dl_slug=$2 [QSA,L]
  33.  
  34. </IfModule>
  35.  
  36. ErrorDocument 404 /404.php
  37.  
  38. <IfModule mod_security.c>
  39. SecFilterEngine Off
  40. </IfModule>
  41.  
  42. <IfModule mod_headers.c>
  43. Header set Connection keep-alive
  44. # 1 year
  45. ExpiresActive On
  46. ExpiresByType image/jpg "access 1 year"
  47. ExpiresByType image/jpeg "access 1 year"
  48. ExpiresByType image/gif "access 1 year"
  49. ExpiresByType image/png "access 1 year"
  50. ExpiresByType text/css "access 1 month"
  51. ExpiresByType text/html "access 1 month"
  52. ExpiresByType application/pdf "access 1 month"
  53. ExpiresByType text/x-javascript "access 1 month"
  54. ExpiresByType application/x-shockwave-flash "access 1 month"
  55. ExpiresByType image/x-icon "access 1 year"
  56. ExpiresDefault "access 1 month"
  57.  
  58. # 2 DAYS
  59. <FilesMatch "\.(xml|txt)$">
  60. Header set Cache-Control "max-age=172800, public, must-revalidate"
  61. </FilesMatch>
  62.  
  63. # 45 MIN
  64. <FilesMatch "\.(html|htm)$">
  65. Header set Cache-Control "max-age=2700, public, must-revalidate"
  66. </FilesMatch>
  67.  
  68. # No cache
  69. <FilesMatch "\.(pl|php|cgi|spl)$">
  70. Header unset Cache-Control
  71. Header unset Expires
  72. Header unset Last-Modified
  73. FileETag None
  74. Header unset Pragma
  75. </FilesMatch>
  76. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement