#only if using apache

ErrorDocument 404 /error?err=404
ErrorDocument 403 /error?err=403
ErrorDocument 400 /error?err=400
ErrorDocument 502 /error?err=502
ErrorDocument 504 /error?err=504

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^(.*)\.aspx$ $1 [L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^(.*)\.ashx$ $1 [L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^(.*)\.html$ $1 [L]