#Enable PHP 5.3
#AddHandler application/x-httpd-php53  .php53 .php

Options +FollowSymLinks -Indexes -MultiViews
#RewriteEngine On
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

############################################
#Redirect to www.

#RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

############################################
## never rewrite for existing files, directories and links

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

############################################
## Never rewrite for not existing js|css|jpg|gif|png|jpeg|swf

RewriteCond %{REQUEST_URI} !^(.*).(js|css|jpg|gif|png|jpeg|swf)$

############################################
## Rewrite all other requests to index.phpz

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

############################################
## Deflate 

AddDefaultCharset UTF-8
<IfModule mod_deflate.c>
	SetOutputFilter DEFLATE
    AddOutPutFilterByType DEFLATE text/html text/plain text/xml text/css text/js text/javascript application/javascript
    <IfModule mod_setenvif.c>
        # Netscape 4.x has some problems...
        BrowserMatch ^Mozilla/4 gzip-only-text/html

        # Netscape 4.06-4.08 have some more problems
        BrowserMatch ^Mozilla/4\.0[678] no-gzip

        # MSIE masquerades as Netscape, but it is fine
        # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

        # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
        # the above regex won't work. You can use the following
        # workaround to get the desired effect:
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

        # Don't compress images
        SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    </IfModule>

    <IfModule mod_headers.c>
        # Make sure proxies don't deliver the wrong content
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
</IfModule>


############################################
## Set expire header for static contents

ExpiresActive On
ExpiresDefault A0

# 1 WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
ExpiresDefault A604800
</FilesMatch>

# 1 WEEK
<FilesMatch "\.(txt|xml|js|ico|css)$">
ExpiresDefault A604800
</FilesMatch>

# 1 WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>

# 1 WEEK
<FilesMatch "\.(txt|xml|js|ico|css)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>

AuthType Basic
AuthName "Auth Required"
AuthUserFile "/home/ssloorjit/public_html/prod-lm.ssl.oorjit.com/passwd"
require valid-user

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
