# Redirect non-www to www

# Redirect 400,401,403,404,500 to main website
error_page 400 401 403 404 500 https://www.seakayak-krabi.com

# Create pretty URLs
# End: Create pretty URLs

# Specific redirections
rewrite ^/search/label/One\sDay\sTours$ /search/label/OneDayTours.html? permanent;
rewrite ^/search/label/Recommended\sTours$ /search/label/RecommendedTours.html? permanent;
rewrite ^/search/label/Package\sTours$ /search/label/PackageTours.html? permanent;
if ($args ~* ^gtnjs=1$){ rewrite ^/$ /gtnjs-1.html? permanent; }
if ($args ~* ^pid=9PO14DDJ1$){ rewrite ^/$ /pid-9PO14DDJ1.html? permanent; }
rewrite ^/common/onlineService/InfoPublish/Major\smatters$ /common/onlineService/InfoPublish/Majormatters.html? permanent;
rewrite ^/common/onlineService/InfoPublish/tempReport/\sfunding\soperation$ /common/onlineService/InfoPublish/tempReport/fundingoperation.html? permanent;
rewrite ^/common/onlineService/InfoPublish/tempReport/Internet\sinsurance$ /common/onlineService/InfoPublish/tempReport/Internetinsurance.html? permanent;
rewrite ^/common/onlineService/InfoPublish/tempReport/New\sproduct$ /common/onlineService/InfoPublish/tempReport/Newproduct.html? permanent;
if ($args ~* ^Category=0$){ rewrite ^/gallery$ /gallery/Category-0.html? permanent; }
if ($args ~* ^Category=1$){ rewrite ^/gallery$ /gallery/Category-1.html? permanent; }
if ($args ~* ^Category=2$){ rewrite ^/gallery$ /gallery/Category-2.html? permanent; }
if ($args ~* ^Category=3$){ rewrite ^/gallery$ /gallery/Category-3.html? permanent; }
if($is_args = ''){ rewrite ^/index\.htm$ /index_htm.html? permanent; }
if($is_args = ''){ rewrite ^/index\.php$ /index_php.html? permanent; }
if ($args ~* ^200=Mjg0NTczMjAy&21=MjA3LjI0MS4yMzIuNDQ=&681=MTUyMjMwNjg2NjBlYjQwZWUwZjI2NDA4ZTU3ZjA3YjMwNGUzNmRlZTNl&crc=21c03e9eca3265bc9b5a5adb8635c0a2718c0348&cv=1$){ rewrite ^/search/tsc\.php$ /search/tsc_200-Mjg0NTczMjAy-21-MjA3LjI0MS4yMzIuNDQ--681-MTUyMjMwNjg2NjBlYjQwZWUwZjI2NDA4ZTU3ZjA3YjMwNGUzNmRlZTNl-crc-21c03e9eca3265bc9b5a5adb8635c0a2718c0348-cv-1.html? permanent; }
if ($args ~* ^fp=vduz90tU7TMSwspHX3xCaeUpA43O\%2FYGE0kphOeyfuOVF81mJmKcffJcQve0MheUdLZlTvPHHxY5acj1tSD1vgA\%3D\%3D&prvtof=VH0U5MUt86NEuDofQCgP\%2FrTJwufphM5q0EWhIjU\%2BjdNG\%2FSooFGqG\%2FQG0bKJQWferRI6e9q\%2BXRD\%2FjysQZZCjQKX3KZ9\%2FSMOtz0lpFvba8ND0T\%2FlnN3hPfLb2ehePJz6D9iQhAX8RqBxmm77ZRCbaTnbGrhspLuiJ3icl69NnZIAbRFeqePRws7NOIdPqB0R82GcXnsyEfEYqMzjMPS61xnfMEnFvg4YWboWe6\%2BqUYfxLmhNKe0rrpHJ0tkETxaxTAMWOrIK0BOG0U1rPNHZKxrOWO6p3XiAuLJnjYWEDmTr6rVPJv6NfQn\%2F\%2FIl274\%2BITJ&poru=ASUP5Dr0hV0gAfVoEjt0b8x0agvdkwRQrhZC8XT9fLt2\%2B5cY\%2FXITF0yaruU0Rd\%2BEvbt47Anj3dtIAg7nZB5VJg\%3D\%3D&$){ rewrite ^/$ /files/XITF0yaruU0Rd-Evbt47Anj3dtIAg7nZB5VJg---_q803dw7gxpx7mzrjammfyc.html? permanent; }
if ($args ~* ^Category=3$){ rewrite ^/gallery$ /gallery_Category-3.html? permanent; }

# 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
