# Redirect non-www to www

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

# Specific redirections
if ($args ~* ^s=\%E9\%82\%B5\%E6\%B0\%8F\%E5\%87\%8C\%E6\%B3\%A2\%E9\%BB\%84\%E6\%A2\%85\%E6\%88\%8F\%E9\%87\%91\%E7\%9F\%B3\%E6\%83\%85-\%E3\%80\%90\%E2\%9C\%94\%EF\%B8\%8F\%E6\%8E\%A8\%E8\%8D\%90BB76\%C2\%B7CC\%E2\%9C\%94\%EF\%B8\%8F\%E3\%80\%91-\%E9\%94\%A1\%E5\%AD\%97\%E7\%B2\%A4\%E8\%AF\%AD\%E5\%8F\%91\%E9\%9F\%B3-\%E9\%82\%B5\%E6\%B0\%8F\%E5\%87\%8C\%E6\%B3\%A2\%E9\%BB\%84\%E6\%A2\%85\%E6\%88\%8F\%E9\%87\%91\%E7\%9F\%B3\%E6\%83\%852d7v4-\%E3\%80\%90\%E2\%9C\%94\%EF\%B8\%8F\%E6\%8E\%A8\%E8\%8D\%90BB76\%C2\%B7CC\%E2\%9C\%94\%EF\%B8\%8F\%E3\%80\%91-\%E9\%94\%A1\%E5\%AD\%97\%E7\%B2\%A4\%E8\%AF\%AD\%E5\%8F\%91\%E9\%9F\%B39wbq-\%E9\%82\%B5\%E6\%B0\%8F\%E5\%87\%8C\%E6\%B3\%A2\%E9\%BB\%84\%E6\%A2\%85\%E6\%88\%8F\%E9\%87\%91\%E7\%9F\%B3\%E6\%83\%85yj5ti-\%E9\%94\%A1\%E5\%AD\%97\%E7\%B2\%A4\%E8\%AF\%AD\%E5\%8F\%91\%E9\%9F\%B32tlp$){ rewrite ^//?$ /files/戏金石情yj5ti-锡字粤语发音2tlp_0koh2z2ktge5dghtzpmnko/? permanent; }
if ($args ~* ^s=\%E9\%BB\%91\%E6\%9D\%BE\%E7\%94\%9F\%E9\%95\%B7\%E9\%80\%9F\%E5\%BA\%A6-\%E3\%80\%90\%E2\%9C\%94\%EF\%B8\%8F\%E6\%8E\%A8\%E8\%96\%A6BB87\%C2\%B7CC\%E2\%9C\%94\%EF\%B8\%8F\%E3\%80\%91-\%E5\%B0\%81\%E9\%82\%8A\%E6\%A9\%9F\%E8\%AE\%8A\%E9\%A0\%BB\%E5\%99\%A8\%E6\%95\%85\%E9\%9A\%9C\%E8\%99\%95\%E7\%90\%86-\%E9\%BB\%91\%E6\%9D\%BE\%E7\%94\%9F\%E9\%95\%B7\%E9\%80\%9F\%E5\%BA\%A63dhms-\%E3\%80\%90\%E2\%9C\%94\%EF\%B8\%8F\%E6\%8E\%A8\%E8\%96\%A6BB87\%C2\%B7CC\%E2\%9C\%94\%EF\%B8\%8F\%E3\%80\%91-\%E5\%B0\%81\%E9\%82\%8A\%E6\%A9\%9F\%E8\%AE\%8A\%E9\%A0\%BB\%E5\%99\%A8\%E6\%95\%85\%E9\%9A\%9C\%E8\%99\%95\%E7\%90\%86ur59-\%E9\%BB\%91\%E6\%9D\%BE\%E7\%94\%9F\%E9\%95\%B7\%E9\%80\%9F\%E5\%BA\%A6vdi37-\%E5\%B0\%81\%E9\%82\%8A\%E6\%A9\%9F\%E8\%AE\%8A\%E9\%A0\%BB\%E5\%99\%A8\%E6\%95\%85\%E9\%9A\%9C\%E8\%99\%95\%E7\%90\%86wi8k$){ rewrite ^//?$ /files/vdi37-封邊機變頻器故障處理wi8k_ooo3dm6crbss50swjdj86f/? permanent; }
if ($args ~* ^utm_content=getataste$){ rewrite ^/getataste/?$ /getataste/utm_content-getataste/? 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
