Answer the question
In order to leave comments, you need to log in
Explain the magic: How does this RewriteRule work?
I came across a completely magical behavior of this rule in htaccess:
RewriteCond %{THE_REQUEST} //
RewriteRule ^(.*)$ /$0 [R=302,L]
AddDefaultCharset utf-8
DirectorySlash Off
RewriteEngine On
RewriteCond %{THE_REQUEST} //
RewriteRule ^(.*)$ /$0 [R=302,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}/index.html -f
RewriteRule ^(.*)$ %{REQUEST_URI}/index.html [R=302,L]
Answer the question
In order to leave comments, you need to log in
everything is simple this rule removes two slashes in a row, if there are 2 of them.
If there are more than a hedgehog, then htaccess spins in a circle until it stops and all urls after passing remain unchanged (this is not a rule, but generally applies to .htaccess). So here everything works locally, there is no magic.
And if you understand that .htaccess is chasing in circles, then the magic disappears.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question