Welcome Guest, Not a member yet? Register   Sign In
redirect all http:// requests to https:// (SSL)
#11

[eluser]Kobus M[/eluser]
[quote author="niwa" date="1329215803"]thanks for the replies,
@robertotra and CroNiX both methods are working, all browsing url are forced in SSL, however,

there is still mixed content due to CSS background images.

Css is correctly loading from https in the browser :
Code:
<link type="text/css" rel="stylesheet" href="https://domain.com/css/main.css" media="screen" />

but inside it, background-image are still loading from http://

I use relative paths as in the CSS file such as :
Code:
background:url(../img/image.png)

Putting absolute paths could probably fix that, but isn't there a more elegant solution ? Absolute paths are hard to maintain as there are different production environments ...



[/quote]

You could look into less. lesscss.org, which allows you to use variables in CSS, where you can define the server base path as a variable in your CSS file.

This is untested, but should give you an idea.

Code:
@development: https://www.impero.co.za/test
@production: https://www.impero.co.za/
@switch: @development;

bg {
    background-image: url(@switch/images/background.png);
}

Hope this helps someone.

Kobus


Messages In This Thread
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 09:37 AM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 10:19 AM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 12:44 PM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 02:21 PM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 02:29 PM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 02:45 PM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 02:57 PM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 03:20 PM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-13-2012, 10:39 PM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-14-2012, 03:36 AM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-14-2012, 04:08 AM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-14-2012, 04:40 AM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-14-2012, 09:30 AM
redirect all http:// requests to https:// (SSL) - by El Forum - 02-16-2012, 06:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB