# 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]

# Prevent scraping from archive for free demo
RewriteCond %{HTTP_USER_AGENT} (ia_archiver) [NC]
RewriteRule . - [F,L]

# 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]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.php$ index_php.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Ovens&eid=40$
RewriteRule ^equipment\.php$ equipment_CAT2-Ovens-eid-40.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Bakery&eid=33$
RewriteRule ^equipment\.php$ equipment_CAT2-Bakery-eid-33.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Beverage\+Dispensers&eid=2$
RewriteRule ^equipment\.php$ equipment_CAT2-Beverage-Dispensers-eid-2.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Broilers&eid=32$
RewriteRule ^equipment\.php$ equipment_CAT2-Broilers-eid-32.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Choppers&eid=4$
RewriteRule ^equipment\.php$ equipment_CAT2-Choppers-eid-4.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Display\+Cases&eid=36$
RewriteRule ^equipment\.php$ equipment_CAT2-Display-Cases-eid-36.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Food\+Processors&eid=9$
RewriteRule ^equipment\.php$ equipment_CAT2-Food-Processors-eid-9.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Freezers&eid=10$
RewriteRule ^equipment\.php$ equipment_CAT2-Freezers-eid-10.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Fryers&eid=11$
RewriteRule ^equipment\.php$ equipment_CAT2-Fryers-eid-11.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Grills&eid=12$
RewriteRule ^equipment\.php$ equipment_CAT2-Grills-eid-12.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Griddle&eid=35$
RewriteRule ^equipment\.php$ equipment_CAT2-Griddle-eid-35.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Ice\+machine&eid=13$
RewriteRule ^equipment\.php$ equipment_CAT2-Ice-machine-eid-13.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Juicers&eid=14$
RewriteRule ^equipment\.php$ equipment_CAT2-Juicers-eid-14.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Kettles&eid=15$
RewriteRule ^equipment\.php$ equipment_CAT2-Kettles-eid-15.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Meat\+Grinders&eid=16$
RewriteRule ^equipment\.php$ equipment_CAT2-Meat-Grinders-eid-16.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Miscellaneous&eid=39$
RewriteRule ^equipment\.php$ equipment_CAT2-Miscellaneous-eid-39.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Mixers&eid=17$
RewriteRule ^equipment\.php$ equipment_CAT2-Mixers-eid-17.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Ovens&eid=18$
RewriteRule ^equipment\.php$ equipment_CAT2-Ovens-eid-18.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Pizza&eid=37$
RewriteRule ^equipment\.php$ equipment_CAT2-Pizza-eid-37.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Refrigeration&eid=21$
RewriteRule ^equipment\.php$ equipment_CAT2-Refrigeration-eid-21.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Shelving&eid=23$
RewriteRule ^equipment\.php$ equipment_CAT2-Shelving-eid-23.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Sinks&eid=31$
RewriteRule ^equipment\.php$ equipment_CAT2-Sinks-eid-31.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Slicers&eid=24$
RewriteRule ^equipment\.php$ equipment_CAT2-Slicers-eid-24.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Smallwares&eid=25$
RewriteRule ^equipment\.php$ equipment_CAT2-Smallwares-eid-25.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Walk-ins&eid=27$
RewriteRule ^equipment\.php$ equipment_CAT2-Walk-ins-eid-27.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Warmers&eid=28$
RewriteRule ^equipment\.php$ equipment_CAT2-Warmers-eid-28.html [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^CAT2=Work\+Tables&eid=29$
RewriteRule ^equipment\.php$ equipment_CAT2-Work-Tables-eid-29.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
