# Redirect 400,401,403,404,500 to main website
error_page 400 401 403 404 500 https://pearlyse.com

# Specific redirections
if ($args ~* ^sku=18065568755845462806873185$){ rewrite ^/products/2024-new-version-creality-k1c-3d-printer-600mm-s-fast-printing-speed-and-clog-free-direct-extruder-support-300%E2%84%83-printing-and-carbon-fiber-filament-auto-leveling-and-ai-camera-8\.66\*8\.66\*9\.84-inch$ /files/68755845462806873185_zcsou042vnbqnzeevj6tq6? permanent; }
if ($args ~* ^sku=18065568755506898586953185$){ rewrite ^/products/adventurer-5m-3d-printer-with-fully-auto-leveling-max-600mm-s-high-speed-printing-280%C2%B0c-direct-extruder-with-3s-detachable-nozzle-core-xy-all-metal-structure-print-size-220x220x220mm$ /files/68755506898586953185_6ruqd4zdqo286u3m32ryk8? permanent; }
if ($args ~* ^sku=18065568756198455430023185$){ rewrite ^/products/assembled-mini-3d-printer-for-kids-and-beginners-complete-starter-kit-with-auto-leveling-3d-printing-machine-10m-pla-filament-and-sd-card-wifi-3d-home-printer-for-mac-windows-and-linux$ /files/68756198455430023185_wd6vckp5w32vd4fj8hf68s? permanent; }

# Create pretty URLs
rewrite ^/([^/]+)$ /$1.html last;
rewrite ^/([^/]+)/([^/]+)$ /$1/$2.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3/$4.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3/$4/$5.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3/$4/$5/$6.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3/$4/$5/$6/$7.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3/$4/$5/$6/$7/$8.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3/$4/$5/$6/$7/$8/$9.html last;
rewrite ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /$1/$2/$3/$4/$5/$6/$7/$8/$9/$10.html last;
# End: Create pretty URLs

# 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
