# Specific redirections
if ($args ~* ^page=2$){ rewrite ^/collections/plantas-medianas$ /collections/plantas-medianas_page-2? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/plantas-grandes$ /collections/plantas-grandes_page-2? permanent; }
if ($args ~* ^page=2$){ rewrite ^/blogs/news$ /blogs/news_page-2? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/all$ /collections/all_page-2? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/plantas-grandes$ /collections/plantas-grandes_page-1? permanent; }
if ($args ~* ^_pos=1&_psq=lengua&_ss=e&_v=1\.0$){ rewrite ^/products/lengua-de-suegra$ /products/lengua-de-suegra__pos-1-_psq-lengua-_ss-e-_v-1_0? permanent; }
if ($args ~* ^page=1$){ rewrite ^/blogs/news$ /blogs/news_page-1? permanent; }
if ($args ~* ^_pos=2&_sid=a1b62c696&_ss=r$){ rewrite ^/blogs/news/regalos-navidenos-plant-lovers$ /blogs/news/regalos-navidenos-plant-lovers__pos-2-_sid-a1b62c696-_ss-r? permanent; }
if ($args ~* ^page=1$){ rewrite ^/collections/plantas-chicas$ /collections/plantas-chicas_page-1? permanent; }
if ($args ~* ^page=2$){ rewrite ^/collections/plantas-chicas$ /collections/plantas-chicas_page-2? permanent; }
if ($args ~* ^_pos=1&_psq=ave\%20vi&_ss=e&_v=1\.0$){ rewrite ^/products/ave-viajera$ /products/ave-viajera__pos-1-_psq-avevi-_ss-e-_v-1_0? permanent; }
if ($args ~* ^_pos=1&_sid=60f464319&_ss=r$){ rewrite ^/products/ave-viajera$ /products/ave-viajera__pos-1-_sid-60f464319-_ss-r? permanent; }
if ($args ~* ^_pos=1&_psq=Cuna\%20de\%20Mois\%C3\%A9s&_ss=e&_v=1\.0$){ rewrite ^/products/cuna-de-moises$ /products/cuna-de-moises__pos-1-_psq-CunadeMoisés-_ss-e-_v-1_0? permanent; }
if ($args ~* ^_pos=1&_sid=50c051d24&_ss=r$){ rewrite ^/products/garra-de-leon-1$ /products/garra-de-leon-1__pos-1-_sid-50c051d24-_ss-r? permanent; }
if ($args ~* ^_pos=1&_sid=92a3acc1b&_ss=r$){ rewrite ^/products/helecho-boston-1$ /products/helecho-boston-1__pos-1-_sid-92a3acc1b-_ss-r? permanent; }
if ($args ~* ^_pos=1&_psq=Lengua\%20de\%20Suegra&_ss=e&_v=1\.0$){ rewrite ^/products/lengua-de-suegra$ /products/lengua-de-suegra__pos-1-_psq-LenguadeSuegra-_ss-e-_v-1_0? permanent; }
if ($args ~* ^_pos=4&_sid=fea044519&_ss=r$){ rewrite ^/products/monstera-deliciosa-1$ /products/monstera-deliciosa-1__pos-4-_sid-fea044519-_ss-r? permanent; }
if ($args ~* ^_pos=4&_sid=96572d4ac&_ss=r$){ rewrite ^/products/palma-areca-1$ /products/palma-areca-1__pos-4-_sid-96572d4ac-_ss-r? permanent; }
if ($args ~* ^_pos=2&_sid=c3ff517b8&_ss=r$){ rewrite ^/products/pandurata$ /products/pandurata__pos-2-_sid-c3ff517b8-_ss-r? 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
