PetaSoft Knowledge Base

Backend

1. General

1.1. ...

2. Initialising the project

2.1. Repository should contain directory with name "www". "www" should contain project.

2.2. Turn on caching. Use sample of .htaccess file below

www/.htaccess

AddDefaultCharset utf-8

<IfModule mod_headers.c>
    <FilesMatch .*\.(js|css)$>
        Header set Cache-control: private
    </FilesMatch>
    <FilesMatch .*\.(gif|jpg|png)$>
        Header set Cache-control: public
    </FilesMatch>
</IfModule>
<IfModule mod_setenvif.c>
  BrowserMatch "MSIE" force-no-vary
  BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary
</IfModule>
FileETag MTime Size
<ifmodule mod_expires.c>
    ExpiresActive on
    ExpiresByType text/html "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"

    <filesmatch ".(jpg|jpeg|gif|png|ico|css|js)$">
        ExpiresActive on
        ExpiresDefault "access plus 1 month"
	</filesmatch>
</ifmodule>
<ifModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip
</ifModule>

RewriteEngine on

RewriteBase /
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteRule ^(.*)(/)$ $1 [L,R=301]

RewriteRule ^(.*)/page/1/(.*) $1/$2 [R=301,L]
RewriteRule ^(.*)/page/1\?(.*) $1?$2 [R=301,L]
RewriteRule ^(.*)/page/1$ $1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

2.3. If gulp or grant uses on project, it should be in root folder.