Options -Indexes
DirectoryIndex index.php
ErrorDocument 404 /404.php

RewriteEngine On
RewriteBase /

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

RewriteRule ^our-services/internet-marketing$ /internet-marketing [R=301,L,QSA]
RewriteRule ^our-services$ /search-engine-optimization [R=301,L,QSA]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L,QSA]

RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L,QSA]

RewriteCond %{THE_REQUEST} ^.*/index
RewriteRule ^(.*)index$ /$1 [R=301,L,QSA]

RewriteCond %{THE_REQUEST} ^(.*)\.php
RewriteCond %{REQUEST_METHOD} GET
RewriteRule ^(.*).php$ /$1 [L,R=301,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1\.php [L,QSA]

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-font-woff "access 1 month"
</IfModule>
## EXPIRES CACHING ##