# invoke rewrite engine
RewriteEngine On
RewriteBase /

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$ / [L,R=301]
RewriteRule ^%2Fknitlet-archive-2022%2F%3Felementor-preview%3D8583%26ver%3D1647875365&amp;flash\=0&amp;wgl\=1&amp;dt\=1647875469538&amp;bpp\=13&amp;bdt\=97468&amp;idt\=-M&amp;shv\=r20220316&amp;mjsv\=m202203100101&amp;ptt\=9&amp;saldr\=aa&amp;cookie\=ID%3D70ea0100af69a350-2268bbdc5ecd0044%3AT%3D1647593639%3ART%3D1647593639%3AS%3DALNI_Maqr4rgAIUzRdbXk-TG5f5UYDUo-w&amp;prev_fmts\=0x0%2C941x200%2C941x200&amp;nras\=1&amp;correlator\=7260205120977&amp;frm\=21&amp;ife\=1&amp;pv\=1&amp;ga_vid\=2050272173\.1645953409&amp;ga_sid\=1647875379&amp;ga_hid\=1134527749&amp;ga_fc\=1&amp;nhd\=1&amp;rplot\=4&amp;u_tz\=120&amp;u_his\=4&amp;u_h\=900&amp;u_w\=1440&amp;u_ah\=813&amp;u_aw\=1440&amp;u_cd\=24&amp;u_sd\=1&amp;adx\=385&amp;ady\=-195&amp;biw\=1430&amp;bih\=581&amp;isw\=1150&amp;ish\=581&amp;ifk\=4032804355&amp;scr_x\=0&amp;scr_y\=0&amp;eid\=44759876%2C44759927%2C44759837%2C42531398%2C44750773%2C31065469%2C31065635%2C31065653&amp;oid\=2&amp;pvsid\=3597566877081334&amp;pem\=842&amp;tmod\=1303053567&amp;nvt\=1&amp;ref\=https%3A%2F%2Fpattern-duchess\.com%2Fwp-admin%2Fpost\.php%3Fpost%3D8583%26action%3Dedit&amp;top\=https%3A%2F%2Fpattern-duchess\.com%2Fwp-admin%2Fpost\.php%3Fpost%3D8583%26action%3Delementor&amp;eae\=0&amp;fc\=1664&amp;brdim\=-1%2C25%2C-1%2C25%2C1440%2C25%2C1430%2C661%2C1150%2C581&amp;vis\=1&amp;rsz\=%7C%7CeE%7C&amp;abl\=CS&amp;pfx\=0&amp;fu\=132&amp;bc\=31&amp;ifi\=8&amp;uci\=8\.nchr8xclxsy9&amp;fsb\=1&amp;xpc\=irkyDIf3So&amp;p\=https%3A//pattern-duchess\.com&amp;dtd\=163$ -dtd-163_ext_iframe/ [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^s=\%7Bsearch_term_string\%7D$
RewriteRule ^/?$ s-{search_term_string}/ [L,R=301,QSD]
RewriteCond %{QUERY_STRING} ^ssp_iabi=1677506810155$
RewriteRule ^how-to-knit-organ-pleats/?$ how-to-knit-organ-pleats/ssp_iabi-1677506810155/ [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
