RewriteEngine On

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

# Remove URL "auto-fixing"
CheckSpelling Off

# 404 redirect
ErrorDocument 404 /404.php

# 301 redirects
#RewriteRule ^OLD-URL/$ http://www.WEBSITE.co.uk/NEW-URL [R=301,L]

# Removing .php file extension from URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]