codestruck/octopus/master/.htaccess - Htaccess File

codestruck/octopus/master/.htaccess

Options -Indexes FollowSymLinks
FileETag None
AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

    RewriteEngine on

    # Block access to .git and .svn directories
    RewriteRule "^(.*/)?.(git|svn)/" - [F,L]

    # Block access to _private
    RewriteRule "^(.*/)?_private/" - [F,L]

    ############################################################################
    #
    # MAINTENANCE/INDEX.HTML SUPPORT
    #   If maintenance/index.html file is present, redirect all non-asset
    #   requests to that.
    #
    ############################################################################

    RewriteCond %{DOCUMENT_ROOT}/maintenance/index.html -f
    RewriteCond %{REQUEST_URI} !/(maintenance)/.* [NC]
    RewriteCond %{REQUEST_URI} !.(jpe?g|png|gif|css|js) [NC]
    RewriteRule .* /maintenance/index.html [L]

    ############################################################################
    #
    # FULL CACHE SUPPORT
    #   If actions set $this->cache to true, the contents of the response are
    #   written to the cache/full directory. Here we check for those cache files
    #   so we can potentially avoid even spinning up PHP in the first place.
    #
    ############################################################################

    AddEncoding x-gzip .gz

    <FilesMatch .*.html.gz>
        # Note that this means that Octopus can only support full-caching
        # responses that are text/html-- setting $this->cache = true for an
        # action that returns a different content type will have no effect.
        ForceType text/html
    </FilesMatch>

    # Ideally, serve up gzipped content directly
    RewriteCond %{REQUEST_METHOD} =GET
    RewriteCond %{QUERY_STRING} !.+
    # See Octopus_Auth_Model for explanation of 0x7A69
    RewriteCond %{HTTP_COOKIE} !.+=0x7A69(;|s|$)
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/cache/full/$1/index.html.gz -f
    RewriteRule ^(.*) %{DOCUMENT_ROOT}/cache/full/$1/index.html.gz [L]

    # Fall back to plain text
    RewriteCond %{REQUEST_METHOD} =GET
    RewriteCond %{QUERY_STRING} !.+
    # See Octopus_Auth_Model for explanation of 0x7A69
    RewriteCond %{HTTP_COOKIE} !.+=0x7A69(;|s|$)
    RewriteCond %{DOCUMENT_ROOT}/cache/full/$1/index.html -f
    RewriteRule ^(.*) %{DOCUMENT_ROOT}/cache/full/$1/index.html [L]

    ############################################################################
    #
    # REDIRECT REQUESTS TO OCTOPUS DRIVER
    #   This enables nice urls.
    #
    ############################################################################

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?__path=$1 [L,QSA]

</IfModule>

# Block access to settings.yaml
<Files "settings.yaml">
    Order allow,deny
    Deny from all
</Files>

# Block access to smarty templates
<Files ~ ".tpl$">
    Order allow,deny
    Deny from all
</Files>

<IfModule mod_php.c>
php_value error_reporting E_ALL
php_flag display_errors 1
php_flag magic_quotes_gpc 0
php_flag auto_detect_line_endings 1
php_flag display_startup_errors 1
</IfModule>

<IfModule mod_php5.c>
php_value error_reporting E_ALL
php_flag display_errors 1
php_flag magic_quotes_gpc 0
php_flag auto_detect_line_endings 1
php_flag display_startup_errors 1
</IfModule>

On Github License

Files

Download PDF of Htaccess file
CACHE, DOCUMENT_ROOT, GET, HTTP_COOKIE, QUERY_STRING, REQUEST_FILENAME, REQUEST_METHOD, REQUEST_URI

Comments

Apache