# invoke rewrite engine
RewriteEngine On
RewriteBase /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/

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

# Add a trailing slash (/) to a URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.[A-Za-z0-9]*$
RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301]

# Specific redirections
RewriteRule ^index\.html$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/ [L,R=301]
RewriteCond %{QUERY_STRING} ^ref=27zs1vad$
RewriteRule ^diskon50/?$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/diskon50/ref-27zs1vad/ [L,R=301,QSD]
RewriteRule ^souvenir-pernikahan/www\.refiza\.com/tasbih-cantik-murah$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/tasbih-cantik-murah/ [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^orderby=price$
RewriteRule ^produk/tasbih/?$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/produk/tasbih/orderby-price/ [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^liquid-footer=main-footer$
RewriteRule ^/?$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/liquid-footer-main-footer/ [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^liquid-header=header-alt$
RewriteRule ^/?$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/liquid-header-header-alt/ [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^liquid-header=main-header$
RewriteRule ^/?$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/liquid-header-main-header/ [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^s=\%7Bsearch_term\%7D$
RewriteRule ^/?$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/s-{search_term}/ [L,R=301,QSD]
RewriteRule ^search/tasbih\+online$ /scraping/files/live/refiza.com_saint.makong_gmail.com_hkw2gjflkr/search/tasbih-online/ [L,R=301,QSD]

# Create pretty URLs
RewriteRule ^([^/]+)/$ $1.html [S=9]
RewriteRule ^([^/]+)/([^/]+)/$ $1/$2.html [S=8]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3.html [S=7]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4.html [S=6]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4/$5.html [S=5]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4/$5/$6.html [S=4]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4/$5/$6/$7.html [S=3]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4/$5/$6/$7/$8.html [S=2]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4/$5/$6/$7/$8/$9.html [S=1]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1/$2/$3/$4/$5/$6/$7/$8/$9/$10.html
# 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
