RewriteEngine On

# RewriteBase
# RewriteBase /

# Only needed for some hosts, if the front returns 403.
# Options +FollowSymlinks

# Memory Limit
# php_value memory_limit 256M
# php_value max_execution_time 18000

# Disable Hotlinking
# Replace "domain.tld" with your domain name
# Don't forget to add a picture "thepic.gif" on your server 
# RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.tld/ [NC]
# RewriteCond %{HTTP_REFERER} !^$
# Solution 1 : Displays another picture from an URL
# RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://www.domain.tld/thepic.gif [L]
# Solution 2 : Displays a 403 forbidden
# RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]

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

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

# Disallow .svn access if you're using SVN
# RedirectMatch 404 /\\.svn(/.*|$)

# Uncomment these lines to display the off.html page to other IP than the one bellow
# RewriteCond %{REMOTE_ADDR} !^127.0.0.1$
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*) off.html

# Content type expiration
# Activate on live website
#<IfModule mod_expires.c>
#	ExpiresActive On
#	ExpiresDefault "access plus 1 seconds"
#	ExpiresByType image/x-icon "access plus 1 year"
#	ExpiresByType image/jpeg "access plus 1 year"
#	ExpiresByType image/png "access plus 1 year"
#	ExpiresByType image/gif "access plus 1 year"
#	ExpiresByType text/css "access plus 1 month"
#	ExpiresByType text/javascript "access plus 1 month"
#	ExpiresByType application/octet-stream "access plus 1 month"
#	ExpiresByType application/x-javascript "access plus 1 month"
#	ExpiresByType application/javascript "access plus 1 month"
#</IfModule>

# Content type max age
# Activate on live website
#<IfModule mod_headers.c>
#	<FilesMatch "\\.(ico|jpe?g|png|gif|swf|woff)$">
#		Header set Cache-Control "max-age=31536000, public"
#	</FilesMatch>
#	<FilesMatch "\\.(css)$">
#		Header set Cache-Control "max-age=2692000, public"
#	</FilesMatch>
#	<FilesMatch "\\.(js)$">
#		Header set Cache-Control "max-age=2692000, private"
#	</FilesMatch>
#	<FilesMatch "\.(js|css|xml|gz)$">
#		Header append Vary: Accept-Encoding
#	</FilesMatch>
#	Header unset ETag
#	Header append Cache-Control "public"
#</IfModule>

# Content type compression
# Activate on live website
#<IfModule mod_deflate.c>
#	AddOutputFilterByType DEFLATE text/plain
#	AddOutputFilterByType DEFLATE text/html
#	AddOutputFilterByType DEFLATE text/xml
#	AddOutputFilterByType DEFLATE text/css
#	AddOutputFilterByType DEFLATE text/javascript
#	AddOutputFilterByType DEFLATE application/xhtml+xml
#	AddOutputFilterByType DEFLATE application/xml
#	AddOutputFilterByType DEFLATE application/rss+xml
#	AddOutputFilterByType DEFLATE application/javascript
#	AddOutputFilterByType DEFLATE application/x-javascript
#	AddOutputFilterByType DEFLATE application/x-httpd-php
#	AddOutputFilterByType DEFLATE application/x-httpd-fastphp
#	AddOutputFilterByType DEFLATE image/svg+xml
#	SetOutputFilter DEFLATE
    # Problematic browsers
#   BrowserMatch ^Mozilla/4 gzip-only-text/html
#	BrowserMatch ^Mozilla/4\.0[678] no-gzip
#	BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
 	# Don't compress images
#	SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
#	SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
#	SetEnvIfNoCase Request_URI \.(?:pdf|avi|mov|mp3|mp4|rm)$ no-gzip dont-vary
    # Make sure proxies don't deliver the wrong content
#   Header append Vary User-Agent env=!dont-vary
#</IfModule>



# DO NOT MODIFY ANY FOLLOWING LINE

# 
# Ionize Rules
#
# If Ionize resized outside the public folder, keep modules asset availability
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(modules)/([a-zA-Z0-9-]+)/(assets)/(.*)$ ../$1/$2/$3/$4

# Keep these lines even in maintenance mode, to have an access to the website
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php/$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(application|modules|plugins|system|themes) index.php/$1 [L]
