Virajsinh

.htaccess

Dec 22nd, 2021 (edited)
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RewriteEngine On
  2.  
  3. <IfModule mod_headers.c>
  4.     Header set Access-Control-Allow-Origin "http://localhost"
  5.     Header set Access-Control-Allow-Credentials true
  6. </IfModule>
  7.  
  8. RewriteCond %{REQUEST_FILENAME} !-f
  9. RewriteCond %{REQUEST_FILENAME} !-d
  10. RewriteRule ^(.*)$ index.php/$1 [L]
  11. # Disable Directory Browsing
  12. Options -Indexes
  13.  
  14. # Hide the contents of directories
  15. #IndexIgnore *
  16.  
  17. <ifmodule mod_deflate.c>
  18.   # Compress HTML, CSS, JavaScript, Text, XML and fonts
  19.   AddOutputFilterByType DEFLATE image/svg+xml
  20.   AddOutputFilterByType DEFLATE application/javascript
  21.   AddOutputFilterByType DEFLATE application/rss+xml
  22.   AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  23.   AddOutputFilterByType DEFLATE application/x-font
  24.   AddOutputFilterByType DEFLATE application/x-font-opentype
  25.   AddOutputFilterByType DEFLATE application/x-font-otf
  26.   AddOutputFilterByType DEFLATE application/x-font-truetype
  27.   AddOutputFilterByType DEFLATE application/x-font-ttf
  28.   AddOutputFilterByType DEFLATE application/x-javascript
  29.   AddOutputFilterByType DEFLATE application/xhtml+xml
  30.   AddOutputFilterByType DEFLATE application/xml
  31.   AddOutputFilterByType DEFLATE font/opentype
  32.   AddOutputFilterByType DEFLATE font/otf
  33.   AddOutputFilterByType DEFLATE font/ttf
  34.   AddOutputFilterByType DEFLATE image/x-icon
  35.   AddOutputFilterByType DEFLATE text/css
  36.   AddOutputFilterByType DEFLATE text/html
  37.   AddOutputFilterByType DEFLATE text/javascript
  38.   AddOutputFilterByType DEFLATE text/plain
  39.   AddOutputFilterByType DEFLATE text/xml
  40.   # Remove browser bugs (only needed for really old browsers)
  41.   BrowserMatch ^Mozilla/4 gzip-only-text/html
  42.   BrowserMatch ^Mozilla/4\.0[678] no-gzip
  43.   BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  44.   Header append Vary User-Agent
  45. </ifmodule>
  46.  
  47. # BEGIN Expire headers  
  48. <IfModule mod_expires.c>  
  49.   # Turn on the module.
  50.   ExpiresActive on
  51.   # Set the default expiry times.
  52.   ExpiresDefault "access plus 2 days"
  53.   ExpiresByType image/jpg "access plus 1 month"
  54.   ExpiresByType image/svg+xml "access 1 month"
  55.   ExpiresByType image/gif "access plus 1 month"
  56.   ExpiresByType image/jpeg "access plus 1 month"
  57.   ExpiresByType image/png "access plus 1 month"
  58.   ExpiresByType text/css "access plus 1 month"
  59.   ExpiresByType text/javascript "access plus 1 month"
  60.   ExpiresByType application/javascript "access plus 1 month"
  61.   ExpiresByType application/x-shockwave-flash "access plus 1 month"
  62.   ExpiresByType image/ico "access plus 1 month"
  63.   ExpiresByType image/x-icon "access plus 1 month"
  64.   ExpiresByType text/html "access plus 600 seconds"
  65. </IfModule>  
  66. # END Expire headers  
Add Comment
Please, Sign In to add comment