Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a website with 3 languages, and each language have their own domain/subdomain, like this.
And I have the following rewrite rule in web.config
<rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> <add input="{HTTP_HOST}" pattern="^(domain\.dk)$" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" /> </rule>
But for some reason http://en.domain.dk and http://de.domain.dk are not redirected to https.
http://en.domain.dk
http://de.domain.dk
If I type http://domain.dk/ everything is dandy and switched to https.
http://domain.dk/
All I want is, to have all subdomains including apex domain, to be forced to https.
Hi Sebastian,
Check the regex on your second input, it says that it must be domain.dk so you are ignoring the sub domains. You can try this one:
^(\w{2}\.)?(domain\.dk)$
Cheers, Cristhian.
Thanks a lot :)
This one also solved it for me.
<rule name="Redirect to https" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" /> </rule>
Make sure to also refer to the documentation about this for Cloud sites, we recommend the rewrite rules as documented so that you can still work locally without having to set up https there.
https://our.umbraco.org/Documentation/Umbraco-Cloud/Set-Up/#running-your-site-on-https-only
The ignore for localhost is missing from both the examples above :-)
That's a good point. Thanks.
This has now moved to: https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Manage-Hostnames/Rewrites-on-Cloud/ for those looking for the docs in future.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Force everything on a specific domain to run https
I have a website with 3 languages, and each language have their own domain/subdomain, like this.
And I have the following rewrite rule in web.config
But for some reason
http://en.domain.dk
andhttp://de.domain.dk
are not redirected to https.If I type
http://domain.dk/
everything is dandy and switched to https.All I want is, to have all subdomains including apex domain, to be forced to https.
Hi Sebastian,
Check the regex on your second input, it says that it must be domain.dk so you are ignoring the sub domains. You can try this one:
Cheers, Cristhian.
Thanks a lot :)
This one also solved it for me.
Make sure to also refer to the documentation about this for Cloud sites, we recommend the rewrite rules as documented so that you can still work locally without having to set up https there.
https://our.umbraco.org/Documentation/Umbraco-Cloud/Set-Up/#running-your-site-on-https-only
The ignore for localhost is missing from both the examples above :-)
That's a good point. Thanks.
This has now moved to: https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Manage-Hostnames/Rewrites-on-Cloud/ for those looking for the docs in future.
is working on a reply...