alphagov / govuk_elements

❗️GOV.UK Elements is deprecated, and will only receive major bug fixes and security patches.
https://govuk-elements.herokuapp.com/
MIT License
227 stars 90 forks source link

Redirect HTTP to HTTPS #582

Closed Nooshu closed 6 years ago

Nooshu commented 6 years ago

We can currently use two urls to get to elements. I believe Search engines are intelligent enough to know the difference so there shouldn't be an SEO impact, but if it is a simple fix then it would be worth making it.

How would you expect it to work?

I would expect HTTP to redirect to HTTPS.

Feel free to suggest a fix...

There is an express module available that we may be able to use that can help us do this. More details about it here

joelanman commented 6 years ago

This was done and then reverted a while ago, not sure why https://github.com/alphagov/govuk_elements/pull/501

Nooshu commented 6 years ago

Original changes in #480. Looks to be using a similar method as used in the heroku-ssl-redirect. @igloosi do you happen to know what broke when this was deployed?

joelanman commented 6 years ago

Might be reading it wrong since I'm on mobile but looks like a possible bug in the original pr:

var utils = path.join(__dirname, '/lib/utils.js')

I think this needs a 'require', like the similar lines above it

Nooshu commented 6 years ago

Well spotted @joelanman, certainly worth investigating. Or we could try the module listed if that is easier?

36degrees commented 6 years ago

Following the launch of the GOV.UK Design System, GOV.UK Elements will now only get major bug fixes and security patches, so I'm going to close this.