CodeIgniter Forums
Decent .htaccess file with mod_pagespeed - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Decent .htaccess file with mod_pagespeed (/showthread.php?tid=55458)



Decent .htaccess file with mod_pagespeed - El Forum - 10-27-2012

[eluser]hasokeric[/eluser]
Code:
<IfModule mod_rewrite.c>
  # Make sure directory listing is disabled
  Options +FollowSymLinks -Indexes
  RewriteEngine on

  # Keep people out of codeigniter directory and Git/Mercurial data
  RedirectMatch 403 ^/(system|\.git|\.hg).*$

  # Send request via index.php (again, not if its a real file or folder)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d

  <IfModule mod_php5.c>
    RewriteRule ^(.*)$ index.php/$1 [L]
  </IfModule>

  <IfModule !mod_php5.c>
    RewriteRule ^(.*)$ index.php?/$1 [L]
  </IfModule>
</IfModule>

<IfModule mod_deflate.c>
  SetOutputFilter DEFLATE
  AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript application/javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
</IfModule>

<IfModule pagespeed_module>
  ModPagespeedEnableFilters insert_img_dimensions
  #ModPagespeedDisableFilters inline_images
  ModPagespeedEnableFilters remove_quotes,remove_comments
  ModPagespeedEnableFilters combine_javascript
</IfModule>