Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1535

Apache 308 redirects change the protocal from https to http

$
0
0

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?


Viewing all articles
Browse latest Browse all 1535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>