PhilSciAssoc/WebsiteJoomla/master/.htaccess - Htaccess File

PhilSciAssoc/WebsiteJoomla/master/.htaccess

Options +FollowSymLinks

<IfModule mod_mime.c>
  AddType application/rss+xml rss
  AddType image/gif gif
  AddType image/jpg jpg
  AddType image/png png
  AddType text/css css
  AddType text/javascript js
  AddCharset UTF-8 .css .html .js
  
  AddType  application/vnd.openxmlformats  .docx .pptx .xlsx .xltx . xltm .dotx .potx .ppsx
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/jpg "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
        ExpiresByType text/css "access plus 1 month"
        ExpiresByType text/javascript "access plus 1 month"
  ExpiresDefault "modification plus 1 week"
</IfModule>

<IfModule mod_headers.c>
  <Files *.html>
    Header append Cache-Control "public, must-revalidate"
  </Files>
</IfModule>

## Mod_rewrite in use.

RewriteEngine On

RewriteBase /joomla/

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!

    # Block out any script trying to base64_encode data within the URL.
    RewriteCond %{QUERY_STRING} base64_encode[^(]*([^)]*) [OR]

    # Block out any script that includes a <script> tag in URL.
    RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]

    # Block out any script trying to set a PHP GLOBALS variable via URL.
    RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]

    # Block out any script trying to modify a _REQUEST variable via URL.
    RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})

    # Return 403 Forbidden header and show the content of the root homepage
    RewriteRule .* index.php [F]

## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects

    RewriteRule ^/*conferences.html$ meetings.html [R=permanent,L]
    RewriteRule ^/*conferences/psa2010/(.*.pdf)$ files/$1 [R=permanent,L]
    RewriteRule ^/*jobs/(.*)$ resources/jobs/$1 [R=permanent,L]
    RewriteRule ^/*conferences/(.*)$ meetings/$1 [R=permanent,L]
    RewriteRule ^/*Membership/?$ membership.html [R=permanent,L]

    RewriteRule ^/*about/index.html$ about.html [R=permanent,L]
    RewriteRule ^/*news/ announcements/archive.html [R=permanent,L]
    RewriteRule ^/*newsletter/ announcements/newsletter.html [R=permanent,L]
    RewriteRule ^/*resources/index.html$ resources.html [R=permanent,L]
    RewriteRule ^/*resources/education/index.html$ resources/education.html [R=permanent,L]
    RewriteRule ^/*resources/jobs/index.html$ resources/jobs.html [R=permanent,L]
    RewriteRule ^/*meetings/index.html$ meetings.html [R=permanent,L]
    RewriteRule ^/*meetings/(psa[^/]+)/index.html$ meetings/$1.html [R=permanent,L]

    RewriteRule ^/*sitemap.xml index.php?option=com_xmap&view=xml&id=1 [L]

## End - Custom redirects

## Begin - Joomla! core SEF Section.

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # If the requested path and file is not /index.php and the request
    # has not already been internally rewritten to the index.php script
    RewriteCond %{REQUEST_URI} !^/index.php

    # and the request is for something within the component folder,
    # or for the site root, or for an extensionless URL, or the
    # requested URL ends with one of the listed extensions
    RewriteCond %{REQUEST_URI} /component/|(/[^.]*|.(php|html?|feed|pdf|vcf|raw))$ [NC]

    # and the requested path and file doesn't directly match a physical file
    RewriteCond %{REQUEST_FILENAME} !-f

    # and the requested path and file doesn't directly match a physical folder
    RewriteCond %{REQUEST_FILENAME} !-d

    # internally rewrite the request to the index.php script
    RewriteRule .* index.php [L]

## End - Joomla! core SEF Section.

On Github License

Files

Download PDF of Htaccess file
QUERY_STRING, REQUEST_FILENAME, REQUEST_URI

Comments

Apache