So I recently updated my .htaccess to replicate the directory slash directive with a 308 instead of the 301 Apache normally uses, so that the browser repeats the same request instead of changing it to a GET request and droping the data from other request methods.
# Disable DirectorySlash Off# Recreate the DirectorySlash directive with 308RewriteCond %{REQUEST_FILENAME} -dRewriteRule ^(.+[^/])$ /$1/ [R=308,L]
This works great in my local tests but when I use my testing server that uses HTTPS it suddenly breaks.In Chrome devtools I can see its being directed to a non secure url or some reason.
Error:
Mixed Content: The page at 'https://...' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://...'. This request has been blocked; the content must be served over HTTPS.
I've also tried adding the request scheme like so and its had no effect.
RewriteRule ^(.+[^/])$ %{REQUEST_SCHEME}://%{HTTP_HOST}/$1/ [R=308,L]
Anyone know why Apache changes the protocol to an insecure one?