DirectoryIndex index.php index.html
AddDefaultCharset UTF-8
<Files ~ "include|used">
Order allow,deny
Deny from all
</Files>
<Files ~ "(.dat|.tpl|error_log|.htaccess)$">
Order allow,deny
Deny from all
</Files>
#php_flag disable_functions passthru,system,shell_exec,popen
#php_value register_globals Off
#php_value session.use_trans_sid Off
#php_value safe_mode_gid On
#php_value safe_mode_include_dir On
#php_value magic_quotes_gpc Off
#php_value magic_quotes_runtime Off
#php_value magic_quotes_sybase Off
#php_value file_uploads On
#php_value display_errors Off
ErrorDocument 400 /pages/error.php?error=400
ErrorDocument 401 /pages/error.php?error=401
ErrorDocument 402 /pages/error.php?error=402
ErrorDocument 403 /pages/error.php?error=403
ErrorDocument 404 /pages/error.php?error=404
ErrorDocument 406 /pages/error.php?error=406
ErrorDocument 500 /pages/error.php?error=500
ErrorDocument 502 /pages/error.php?error=502
# ----------------------------------------------------------------------
# Expires headers (for better cache control) (SEO and site performance improvements)
# ----------------------------------------------------------------------
#
# If you don`t use filenames to version, lower the css and js to something like "access plus 1 week"
#
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
# ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Your document html
# ExpiresByType text/html "access plus 0 seconds"
# Data
# ExpiresByType text/xml "access plus 0 seconds"
# ExpiresByType application/xml "access plus 0 seconds"
# ExpiresByType application/json "access plus 0 seconds"
# RSS feed
# ExpiresByType application/rss+xml "access plus 1 hour"
# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Webfonts
ExpiresByType font/truetype "access plus 1 year"
ExpiresByType font/opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
# CSS and JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
# Force no caching for dynamic files
# <FilesMatch "\.(php)$">
# ExpiresActive Off
# </FilesMatch>
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
# pagespeed module
<IfModule pagespeed_module>
ModPagespeed off
</IfModule>
# commpression mod_deflate
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
RewriteEngine on
# Include in the next line all folders to exclude
# The [NC] flag here stands for No Case, so you don't have to worry about case sensitivity.
RewriteCond %{REQUEST_URI} !(js|img|fls) [NC]
# force https protocol
#RewriteCond %{HTTPS} !=on
#RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
# seo friendly home page language url. example.com/en/
# QSA - This rule appends the GET query string which results from the ReWrite rule to the initial GET query string sent by the browser.
RewriteRule ^([a-zA-Z]{2})\b/?$ index.php?ln=$1 [QSA]
# deny adding www. or other subdomain to site address
# The [L] flag stands for "Last", meaning that if this condition is true, execute the RewriteRule and do not attempt to match other RewriteConds or perform other operations on the request.
# The [R] flag stands for "Redirect". You can pass in an option to R to set the HTTP status code of the redirect. Example [R=302] or [R=404].
# RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
# Redirect to www.
# RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
# RewriteCond %{HTTPS}s ^on(s)|
# RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# website pages
RewriteRule ^page\/([^\/]+)\/?$ pages/pages.php?pg=$1 [NC,L]
# end of website pages
# website blog pages
RewriteRule ^blog\/$ pages/blog.php
RewriteRule ^blog\/([^\/]+)\/?$ pages/blog.php?pg=$1 [NC,L]
# end of website blog pages
# website content - tag search
RewriteRule ^search\/([^\/]+)\/page=([0-9]*)$ search.php?item=$1&page=$2 [NC,L]
RewriteRule ^search\/([^\/]+)\/?$ search.php?item=$1 [NC,L]
RewriteRule ^search$ search.php [NC,L]
# end of website content - tag search
# website custom pages
# custom_link - don't remove
# end of website custom pages