kammerer The original solution only applied to the root url (http://ledstrain.org/
)
Took me awhile, but things should be improved. The exceptions are www urls with a link to a discussion.
for url in "http://ledstrain.org" \
"http://ledstrain.org/d/404" \
"http://www.ledstrain.org/" \
"http://www.ledstrain.org/d/404" \
"https://www.ledstrain.org" \
"https://www.ledstrain.org/d/404" \
; do echo "$url" '->' $(curl -v "$url" 2>&1 | grep -m1 'Location' | cut -d' ' -f3); done
http://ledstrain.org -> https://ledstrain.org/
http://ledstrain.org/d/404 -> https://ledstrain.org/d/404
http://www.ledstrain.org/ -> https://www.ledstrain.org/
http://www.ledstrain.org/d/404 -> https://www.ledstrain.org/d/404
https://www.ledstrain.org -> https://ledstrain.org/
https://www.ledstrain.org/d/404 ->
This is the current .htaccess redirect (there's another one that just forces http -> https), if anyone wants to take a kick at www urls redirecting to the bare domain https://ledstrain.org/
with URI's.
RewriteCond %{HTTPS} on
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^www\.ledstrain\.org$
RewriteRule ^/?$ "https\:\/\/ledstrain\.org\/%{REQUEST_URI}" [R=301,L]