I have the following htaccess file:
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !ssl
....// lots of rewrite rules
RewriteCond %{SERVER_PORT} ^443$
RewriteCond $1 !^ssl
RewriteRule (.*) http://www.mydomain.com/$1 [R,L]
RewriteCond %{SERVER_PORT} ^80$
RewriteCond $1 ^ssl
RewriteRule (.*) https://www.mydomain.com/$1 [R,L]
Basically when I load a secure page I get lots of insecure images and js being loaded
how can I modify my htacccess to get this content loading securely.
Note that the folder for the images and js are
/js
/images
and secure content is served from /ssl
Thanks
You can prevent redirect, for the images and js folder, by putting this at the top of your htaccess:
Also make sure you only use relative or root-relative (or protocol-relative) urls for referencing images and javascript files.