# Redirect non-www to www

# 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

# 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

# Specific redirections
rewrite ^/collections/accessories/dresses\+rompers$ /collections/accessories/dresses-rompers? permanent;
rewrite ^/collections/outerwear/onesies\+baby-rompers$ /collections/outerwear/onesies-baby-rompers? permanent;
if ($args ~* ^q=Dresses$){ rewrite ^/collections/types$ /collections/types_q-Dresses? permanent; }
if ($args ~* ^q=Onesies\%2FRompers$){ rewrite ^/collections/types$ /collections/types_q-Onesies_Rompers? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/all$ /collections/all_page-2? permanent; }
if ($args ~* ^page=15$){ rewrite ^/collections/all$ /collections/all_page-15? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/new$ /collections/new_page-2? permanent; }
if ($args ~* ^page=3$){ rewrite ^/collections/new$ /collections/new_page-3? permanent; }
if ($args ~* ^page=15$){ rewrite ^/collections/new$ /collections/new_page-15? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/accessories$ /collections/accessories_page-2? permanent; }
if ($args ~* ^page=3$){ rewrite ^/collections/accessories$ /collections/accessories_page-3? permanent; }
if ($args ~* ^page=10$){ rewrite ^/collections/accessories$ /collections/accessories_page-10? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/tops$ /collections/tops_page-2? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/accessories/pants$ /collections/accessories/pants_page-2? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-2? permanent; }
if ($args ~* ^page=3$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-3? permanent; }
if ($args ~* ^page=11$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-11? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/outerwear/baby-dresses$ /collections/outerwear/baby-dresses_page-2? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/dresses$ /collections/dresses_page-2? permanent; }
if ($args ~* ^page=3$){ rewrite ^/collections/dresses$ /collections/dresses_page-3? permanent; }
if ($args ~* ^page=5$){ rewrite ^/collections/dresses$ /collections/dresses_page-5? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/bottoms$ /collections/bottoms_page-2? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/sale-1$ /collections/sale-1_page-2? permanent; }
if ($args ~* ^page=3$){ rewrite ^/collections/sale-1$ /collections/sale-1_page-3? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/sold-out$ /collections/sold-out_page-2? permanent; }
if ($args ~* ^page=3$){ rewrite ^/collections/sold-out$ /collections/sold-out_page-3? permanent; }
if ($args ~* ^page=14$){ rewrite ^/collections/sold-out$ /collections/sold-out_page-14? permanent; }
if ($args ~* ^q=Pants$){ rewrite ^/collections/types$ /collections/types_q-Pants? permanent; }
if ($args ~* ^q=Tops$){ rewrite ^/collections/types$ /collections/types_q-Tops? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/tops$ /collections/tops_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/tops$ /collections/tops_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/tops$ /collections/tops_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/tops$ /collections/tops_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/tops$ /collections/tops_sort_by-title-descending? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/tops$ /collections/tops_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/tops$ /collections/tops_sort_by-created-descending? permanent; }
if ($args ~* ^sort_by=best-selling$){ rewrite ^/collections/tops$ /collections/tops_sort_by-best-selling? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/new$ /collections/new_page-1? permanent; }
if ($args ~* ^page=4$){ rewrite ^/collections/new$ /collections/new_page-4? permanent; }
if ($args ~* ^page=14$){ rewrite ^/collections/new$ /collections/new_page-14? permanent; }
if ($args ~* ^page=13$){ rewrite ^/collections/new$ /collections/new_page-13? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/accessories$ /collections/accessories_page-1? permanent; }
if ($args ~* ^page=9$){ rewrite ^/collections/accessories$ /collections/accessories_page-9? permanent; }
if ($args ~* ^page=8$){ rewrite ^/collections/accessories$ /collections/accessories_page-8? permanent; }
if ($args ~* ^q=Shorts$){ rewrite ^/collections/types$ /collections/types_q-Shorts? permanent; }
if ($args ~* ^page=4$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-4? permanent; }
if ($args ~* ^page=5$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-5? permanent; }
if ($args ~* ^page=10$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-10? permanent; }
if ($args ~* ^page=9$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-9? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/outerwear$ /collections/outerwear_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/outerwear$ /collections/outerwear_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/outerwear$ /collections/outerwear_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/outerwear$ /collections/outerwear_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/outerwear$ /collections/outerwear_sort_by-title-descending? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/outerwear$ /collections/outerwear_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/outerwear$ /collections/outerwear_sort_by-created-descending? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/dresses$ /collections/dresses_page-1? permanent; }
if ($args ~* ^page=6$){ rewrite ^/collections/dresses$ /collections/dresses_page-6? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-title-descending? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-created-descending? permanent; }
if ($args ~* ^sort_by=best-selling$){ rewrite ^/collections/bottoms$ /collections/bottoms_sort_by-best-selling? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/bottoms$ /collections/bottoms_page-1? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/sale-1$ /collections/sale-1_page-1? permanent; }
if ($args ~* ^page=4$){ rewrite ^/collections/sale-1$ /collections/sale-1_page-4? permanent; }
if ($args ~* ^page=5$){ rewrite ^/collections/sale-1$ /collections/sale-1_page-5? permanent; }
if ($args ~* ^page=13$){ rewrite ^/collections/sold-out$ /collections/sold-out_page-13? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/ss$ /collections/ss_page-2? permanent; }
if ($args ~* ^page=3$){ rewrite ^/collections/ss$ /collections/ss_page-3? permanent; }
if ($args ~* ^page=8$){ rewrite ^/collections/ss$ /collections/ss_page-8? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/new$ /collections/new_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/new$ /collections/new_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/new$ /collections/new_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/new$ /collections/new_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/new$ /collections/new_sort_by-title-descending? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/new$ /collections/new_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/new$ /collections/new_sort_by-created-descending? permanent; }
if ($args ~* ^sort_by=best-selling$){ rewrite ^/collections/new$ /collections/new_sort_by-best-selling? permanent; }
if ($args ~* ^page=12$){ rewrite ^/collections/new$ /collections/new_page-12? permanent; }
if ($args ~* ^page=11$){ rewrite ^/collections/new$ /collections/new_page-11? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-title-descending? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-created-descending? permanent; }
if ($args ~* ^sort_by=best-selling$){ rewrite ^/collections/accessories$ /collections/accessories_sort_by-best-selling? permanent; }
if ($args ~* ^page=7$){ rewrite ^/collections/accessories$ /collections/accessories_page-7? permanent; }
if ($args ~* ^page=6$){ rewrite ^/collections/accessories$ /collections/accessories_page-6? permanent; }
if ($args ~* ^page=8$){ rewrite ^/collections/outerwear$ /collections/outerwear_page-8? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-title-descending? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-created-descending? permanent; }
if ($args ~* ^sort_by=best-selling$){ rewrite ^/collections/sale-1$ /collections/sale-1_sort_by-best-selling? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/ss$ /collections/ss_page-1? permanent; }
if ($args ~* ^page=6$){ rewrite ^/collections/ss$ /collections/ss_page-6? permanent; }
if ($args ~* ^page=10$){ rewrite ^/collections/new$ /collections/new_page-10? permanent; }
if ($args ~* ^q=Others$){ rewrite ^/collections/types$ /collections/types_q-Others? permanent; }
if ($args ~* ^page=9$){ rewrite ^/collections/new$ /collections/new_page-9? permanent; }
if ($args ~* ^return_url=\%2Faccount$){ rewrite ^/account/login$ /account/login_return_url-_account? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/accessories/tops$ /collections/accessories/tops_page-2? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/dresses$ /collections/dresses_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/dresses$ /collections/dresses_sort_by-created-descending? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/dresses$ /collections/dresses_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/dresses$ /collections/dresses_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/dresses$ /collections/dresses_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/dresses$ /collections/dresses_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/dresses$ /collections/dresses_sort_by-title-descending? permanent; }
if ($args ~* ^variant=31727970615366$){ rewrite ^/collections/face-masks/products/face-masks-black-and-white$ /collections/face-masks/products/face-masks-black-and-white_variant-31727970615366? permanent; }
if ($args ~* ^sort_by=best-selling$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-best-selling? permanent; }
if ($args ~* ^sort_by=created-ascending$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-created-ascending? permanent; }
if ($args ~* ^sort_by=created-descending$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-created-descending? permanent; }
if ($args ~* ^sort_by=manual$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-manual? permanent; }
if ($args ~* ^sort_by=price-ascending$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-price-ascending? permanent; }
if ($args ~* ^sort_by=price-descending$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-price-descending? permanent; }
if ($args ~* ^sort_by=title-ascending$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-title-ascending? permanent; }
if ($args ~* ^sort_by=title-descending$){ rewrite ^/collections/face-masks$ /collections/face-masks_sort_by-title-descending? permanent; }
if ($args ~* ^page=7$){ rewrite ^/collections/sale-1$ /collections/sale-1_page-7? permanent; }
