# Add a trailing slash (/) to a URL
rewrite ^([^.]*[^/])$ $1/ permanent;

# Specific redirections
if ($args ~* ^s=Home&post_type=product&et_search=true$){ rewrite ^//?$ /s-Home-post_type-product-et_search-true/? permanent; }
if ($args ~* ^s=\%20Decor&post_type=product&et_search=true$){ rewrite ^//?$ /s-Decor-post_type-product-et_search-true/? permanent; }
if ($args ~* ^s=\%20Wooden&post_type=product&et_search=true$){ rewrite ^//?$ /s-Wooden-post_type-product-et_search-true/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=2188$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-2188/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=2151$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-2151/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=709$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-709/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6965$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6965/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=7659$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-7659/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=7412$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-7412/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=1466$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-1466/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6371$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6371/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=7868$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-7868/? permanent; }
if ($args ~* ^attribute_pa_cb5feb1b7314637725a2e7=blue-fxq&attribute_pa_eec6c4bdbd339edf8cbea6=about-35cm$){ rewrite ^/product/pumpkin-puff-cushion/?$ /product/pumpkin-puff-cushion/attribute_pa_cb5feb1b7314637725a2e7-blue-fxq-attribute_pa_eec6c4bdbd339edf8cbea6-about-35cm/? permanent; }
if ($args ~* ^view_mode=grid$){ rewrite ^/shop/?$ /shop/view_mode-grid/? permanent; }
if ($args ~* ^view_mode=list$){ rewrite ^/shop/?$ /shop/view_mode-list/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6126$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6126/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6133$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6133/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6149$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6149/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6140$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6140/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=653$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-653/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=52$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-52/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=693$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-693/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=7729$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-7729/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=232$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-232/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=680$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-680/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6227$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6227/? permanent; }
if ($args ~* ^rating_filter=5$){ rewrite ^/shop/?$ /shop/rating_filter-5/? permanent; }
if ($args ~* ^rating_filter=4$){ rewrite ^/shop/?$ /shop/rating_filter-4/? permanent; }
if ($args ~* ^view_mode=grid$){ rewrite ^/product-category/home-decor/?$ /product-category/home-decor/view_mode-grid/? permanent; }
if ($args ~* ^view_mode=list$){ rewrite ^/product-category/home-decor/?$ /product-category/home-decor/view_mode-list/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=6395$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-6395/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=976$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-976/? permanent; }
if ($args ~* ^rating_filter=5$){ rewrite ^/product-category/home-decor/?$ /product-category/home-decor/rating_filter-5/? permanent; }
if ($args ~* ^view_mode=grid$){ rewrite ^/product-category/garden-decor/?$ /product-category/garden-decor/view_mode-grid/? permanent; }
if ($args ~* ^view_mode=list$){ rewrite ^/product-category/garden-decor/?$ /product-category/garden-decor/view_mode-list/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=644$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-644/? permanent; }
if ($args ~* ^et-wishlist-page&add_to_wishlist=1229$){ rewrite ^/my-account-3/?$ /my-account-3/et-wishlist-page-add_to_wishlist-1229/? permanent; }
if ($args ~* ^rating_filter=5$){ rewrite ^/product-category/garden-decor/?$ /product-category/garden-decor/rating_filter-5/? 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
