# invoke rewrite engine
RewriteEngine On
RewriteBase /

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

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

# Specific redirections
RewriteRule ^index\.html$ / [L,R=301]

RewriteCond %{HTTP_HOST} ^saltwatergvl\.com$ [NC]
RewriteRule ^wp-content/uploads/2020/06/Saltwater-Menu-6.2.20-UPDATED.pdf?$ https://saltwatergvl.com/upcoming-events/vimeo-video/ [R=301,L,NE]
RewriteRule ^wp-content/uploads/2019/05/SaltwaterKitchenLunchMenu.pdf?$ https://saltwatergvl.com/our-vacancies/youtube-video/ [R=301,L,NE]
RewriteRule ^wp-content/uploads/2019/07/Saltwater_Kitchen_Sweet_Endings_Menu.pdf?$ https://saltwatergvl.com/free-cup-of-she-crab-soup/ [R=301,L,NE]
RewriteRule ^wp-content/uploads/2020/01/SaltwaterKitchenMenu-1.10.20.pdf?$ https://saltwatergvl.com/free-cup-of-she-crab-soup/attachment/mailer_coupon-01/ [R=301,L,NE]
RewriteRule ^wp-content/uploads/2019/06/Saltwater_Kitchen_Lunch_Menu.pdf?$ https://saltwatergvl.com/saltwaterkitchen_logo_clean_white_full210x/ [R=301,L,NE]



# Create pretty URLs
DirectorySlash Off

RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ %1 [NC,L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} (.*)/$
RewriteRule ^(.*)/$ $1 [NC,L,R=301]

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

# 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

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
