# Redirect non-www to www

# Redirect 400,401,403,404,500 to main website
error_page 400 401 403 404 500 http://www.oregonmotorcycleparts.com

# Create pretty URLs
# End: Create pretty URLs

# Specific redirections
if ($args ~* ^D=A$){ rewrite ^/Diagrams$ /Diagrams/D-A.html? permanent; }
if ($args ~* ^M=A$){ rewrite ^/Diagrams$ /Diagrams/M-A.html? permanent; }
if ($args ~* ^N=D$){ rewrite ^/Diagrams$ /Diagrams/N-D.html? permanent; }
if ($args ~* ^S=A$){ rewrite ^/Diagrams$ /Diagrams/S-A.html? permanent; }

# Redirect all extensions to html
if ($is_args = ''){
	rewrite ^([^.]*)\.shtml$ $1.html permanent;
	rewrite ^([^.]*)\.phtml$ $1.html permanent;
	rewrite ^([^.]*)\.jhtml$ $1.html permanent;
	rewrite ^([^.]*)\.htm$ $1.html permanent;
	rewrite ^([^.]*)\.php$ $1.html permanent;
	rewrite ^([^.]*)\.aspx$ $1.html permanent;
	rewrite ^([^.]*)\.asp$ $1.html permanent;
	rewrite ^([^.]*)\.jsp$ $1.html permanent;
	rewrite ^([^.]*)\.apk$ $1.html permanent;
}
# End: Redirect all extensions to html
