Htaccess File


# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Turn off the automatic append of slash for directories.
DirectorySlash Off

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  <FilesMatch .html$>
    # While normally we would want html files to be cached, since they are
    # regularly regenerated, old versions get left in browser cache.
    # By turning it off for html files we allow refreshing the files.
    ExpiresActive Off

  <FilesMatch ^esi/>
    # Don't cache esi either as it needs to change frequently.
    ExpiresActive Off


<IfModule mod_include.c>
  # Turn on SSI Includes and set executable html to use includes.
  Options +Includes
  XBitHack on

<IfModule mod_rewrite.c>
  RewriteEngine on
  # 301 Redirects to
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s([^.]+).html [NC]
  RewriteRule ^ %1 [R=301,L,NC]

  # Internal redirect querystring parameters to files.
  # to node_page=1.html
  RewriteCond %{REQUEST_FILENAME}_%{QUERY_STRING}.html -s
  RewriteRule ^ %{REQUEST_URI}_%{QUERY_STRING}.html [L]

  # Internally redirect paths to their html equivalents.
  # to
  RewriteCond %{REQUEST_FILENAME}.html -s
  RewriteRule ^ %{REQUEST_URI}.html [L]
Exit mobile version