# invoke rewrite engine
RewriteEngine On
RewriteBase /

Options -Indexes
<IfModule mod_negotiation.c>
	Options -MultiViews
</IfModule>

# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

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

# Create pretty URLs
DirectorySlash Off

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
# End: Create pretty URLs

# Specific redirections
RewriteRule ^index\.html$ / [L,R=301]
RewriteRule ^search/label/One\sDay\sTours$ search/label/OneDayTours.html [L,R=301,QSD]
RewriteRule ^search/label/Recommended\sTours$ search/label/RecommendedTours.html [L,R=301,QSD]
RewriteRule ^search/label/Package\sTours$ search/label/PackageTours.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^gtnjs=1$
RewriteRule ^$ gtnjs-1.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^pid=9PO14DDJ1$
RewriteRule ^$ pid-9PO14DDJ1.html [L,R=301,QSD]
RewriteRule ^common/onlineService/InfoPublish/Major\smatters$ common/onlineService/InfoPublish/Majormatters.html [L,R=301,QSD]
RewriteRule ^common/onlineService/InfoPublish/tempReport/\sfunding\soperation$ common/onlineService/InfoPublish/tempReport/fundingoperation.html [L,R=301,QSD]
RewriteRule ^common/onlineService/InfoPublish/tempReport/Internet\sinsurance$ common/onlineService/InfoPublish/tempReport/Internetinsurance.html [L,R=301,QSD]
RewriteRule ^common/onlineService/InfoPublish/tempReport/New\sproduct$ common/onlineService/InfoPublish/tempReport/Newproduct.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^Category=0$
RewriteRule ^gallery$ gallery/Category-0.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^Category=1$
RewriteRule ^gallery$ gallery/Category-1.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^Category=2$
RewriteRule ^gallery$ gallery/Category-2.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^Category=3$
RewriteRule ^gallery$ gallery/Category-3.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.htm$ index_htm.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.php$ index_php.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^200=Mjg0NTczMjAy&21=MjA3LjI0MS4yMzIuNDQ=&681=MTUyMjMwNjg2NjBlYjQwZWUwZjI2NDA4ZTU3ZjA3YjMwNGUzNmRlZTNl&crc=21c03e9eca3265bc9b5a5adb8635c0a2718c0348&cv=1$
RewriteRule ^search/tsc\.php$ search/tsc_200-Mjg0NTczMjAy-21-MjA3LjI0MS4yMzIuNDQ--681-MTUyMjMwNjg2NjBlYjQwZWUwZjI2NDA4ZTU3ZjA3YjMwNGUzNmRlZTNl-crc-21c03e9eca3265bc9b5a5adb8635c0a2718c0348-cv-1.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^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&$
RewriteRule ^$ files/XITF0yaruU0Rd-Evbt47Anj3dtIAg7nZB5VJg---_q803dw7gxpx7mzrjammfyc.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^Category=3$
RewriteRule ^gallery$ gallery_Category-3.html [L,R=301,QSD]

# Redirect all extensions to html
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.shtml$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.phtml$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.jhtml$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.htm$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.php$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.aspx$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.asp$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.jsp$ $1.html [L,NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.apk$ $1.html [L,NC,R=301]
# End: Redirect all extensions to html
