Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Hosting Requirements /

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Website migration error


Go to End


2 Posts   1659 Views

Avatar
SilverstripeLearner

Community Member, 15 Posts

22 April 2017 at 12:39am

I migrated a website from dev (http) to live (https). The page doesn't load my css and js. After looking at the source it should it's trying to get them via http. I need to get the by https.

Here is the code in my Page.ss where I load my stylesheets and scripts:

<link type="text/css" rel="stylesheet" href="$BaseHref$ThemeDir/assets/css/example.css"/>

and it displays the following line:

http://website.com/themes/the_theme/assets/css/example.css

It should return https

Avatar
Michael J James

Community Member, 8 Posts

26 April 2017 at 2:26am

Hi @SilverstripeLearner,

Have you tried adding Director::forceSSL(); into your _config.php file.

I haven't tested but it should do it.

Thanks
Michael