понедельник, 4 января 2016 г.

Drefault Dev config for SF2

<VirtualHost *:80>
        ServerName irs-sf.akuma.in

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/irs-sf

        <Directory "/var/www/irs-sf">
            <IfModule env_module>
                SetEnv APPLICATION_ENV development
            </IfModule>
            <IfModule mod_headers.c>
                Header set X-Robots-Tag: "noindex, nofollow, noarchive, nosnippet, noimageindex"
            </IfModule>
            DirectoryIndex app_dev.php
            AllowOverride None
            Allow from All
            <IfModule mod_rewrite.c>
                RewriteEngine On

                RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
                RewriteRule ^(.*) - [E=BASE:%1]

                # Sets the HTTP_AUTHORIZATION header removed by apache
                RewriteCond %{HTTP:Authorization} .
                RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

                RewriteCond %{ENV:REDIRECT_STATUS} ^$
                RewriteRule ^app_dev\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,END]

                RewriteCond %{REQUEST_FILENAME} -f
                RewriteRule .? - [L]

                # Rewrite all other queries to the front controller.
                RewriteRule .? %{ENV:BASE}/app_dev.php [L]
            </IfModule>
        </Directory>


        LogLevel error
        ErrorLog ${APACHE_LOG_DIR}/irs-sf/error.log
        CustomLog ${APACHE_LOG_DIR}/irs-sf/access.log combined
</VirtualHost>