function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anuj Joshi 42Anuj Joshi 42 

URL redirection from http to https in sites

Hi All,

We have client who has its own website. When the user clicks in a link he is redirected to force.com site. But he is redirected to site URL which is is in HTTP. My requirement is that the URL should be changed from HTTP to HTTPS. The HTTPS setting checkbox in session settings is enabled. In the login settings of site, the secure web address is given as HTTPS. Is there any way that when user click on the link, it opens HTTPS instead of HTTP site URL. I tried to change to HTTPS in href tag of the website but its not working.

Thanks,
Anuj
Best Answer chosen by Anuj Joshi 42
bhanu_prakashbhanu_prakash
Hi Anuj,

there will not be any impact if you change two settings. It will just redirect url from  Http to Https will happen
Thanks for Update
Mark as resloved if it helps :) :)
Thanks, 
Bhanu Prakash
visit ForceLearn.com​ (https://www.forcelearn.com))
 

All Answers

bhanu_prakashbhanu_prakash
Hi Anuj,
Mark as best answer, If it resloves !!
create a redirect url to from existing http to https url 
follow 

You can use URL redirects to:
Maintain search engine ranking. For example, if you change a page’s name from “Gadgets” to “Widgets,” creating a redirect rule from /Gadgets to /Widgets lets you restructure the site without affecting your page ranking.
Make URLs more readable and memorable. For example, site visitors will find long or numeric page names, such as /widget65AD890004ab9923, difficult to remember. Instead, you can provide them with a short, friendly URL, such as /widget, and create an alias that redirects to the correct page when the user uses the short URL alias.
Assist with migration from another system to Site.com if you’re still using the same domain. For example, if your old site ran on PHP, you can create a redirection rule from an old page, such as /index.php, to a new page in Site.com, such as /myNewPage.
To assign a redirect to a site page:
On the Overview tab, click Site Configuration | URL Redirects.
Click Create a Redirect.
Specify the Redirect type:
OptionDescriptionPermanent (301)Select this option if you want users and search engines to update the URL in their systems when visiting the page. Users visiting a page redirected with this type are sent seamlessly to the new page. Using a permanent redirect ensures that your URLs retain their search engine popularity ratings, and that search engines index the new page and remove the obsolete source URL from their indexes.
Temporary (302)Select this option if you want users and search engines to keep using the original URL for the page. Search engines interpret a 302 redirect as one that could change again at any time, and though they index and serve up the content on the new target page, they also keep the source URL in their indexes.
AliasSelect this option if you don’t want the URL to change in the user’s browser, but you want to redirect to a different page. Search engines won’t be aware of the change or update their records.
Alias redirects only work when you redirect from one Site.com page to another. You can’t create an alias to an external address.
Specify the former page location in the Redirect from field.
The page location must be a relative URL.
The page can have any valid extension type, such as .html or .php, and can contain parameters. Parameter order is irrelevant.
The URL can’t contain anchors, such as /siteprefix/page.html#target.
You can create just one redirection rule from a particular URL. If you create a new rule with the same Redirect From information, the old rule is overwritten.
Specify the new page location in the Redirect to field. This can be a relative URL or a fully-qualified URL with an http:// or https:// prefix. Unlike pages you’re redirecting from, pages you’re redirecting to can contain anchors.
To immediately enable the redirection rule, ensure Active is selected. To enable it at a later stage, deselect the property.
Click Save.
The URL Redirects section displays all URL redirection rules you've created for your site.
Edit an assigned redirect rule by clicking  | Edit Redirect.
Delete a redirect rule by clicking  | Delete Redirect.

check these link for more info
https://help.salesforce.com/articleView?id=siteforce_redirects.htm&type=5 (http://​https://help.salesforce.com/articleView?id=siteforce_redirects.htm&type=5)

please follow same instruction again in New trailhead playground you can able to acheive it.
Mark as resloved if it helps :) :)
Thanks, 
Bhanu Prakash
visit ForceLearn.com​ (https://www.forcelearn.com/)
Anuj Joshi 42Anuj Joshi 42
Hi Bhanu,

In sesstion settings I have enabled the checkbox "HSTS for sites and communities". Also Require connections(HTTPS) checkbox is checked in Site settings. My requirement is to redirect the current site URL which is in HTTP to HTTPS. Will it have any impact if I change the above two settings above.

Thanks,
Anuj
bhanu_prakashbhanu_prakash
Hi Anuj,

there will not be any impact if you change two settings. It will just redirect url from  Http to Https will happen
Thanks for Update
Mark as resloved if it helps :) :)
Thanks, 
Bhanu Prakash
visit ForceLearn.com​ (https://www.forcelearn.com))
 
This was selected as the best answer
Anuj Joshi 42Anuj Joshi 42
Hi Bhanu,

We have a link. Wehn that link is clicked it is opening a site on new tab. Initially it is taking to <domain>.force.com Wehn user enters login details then its is taking us to https://<domain>.secure.force.com?refURL Can we make the first page as secure.force.com?
bhanu_prakashbhanu_prakash
Hi Anuj,
 .secure helps you to check user creditainals. you can do that based on your business case but you can check and need to test more 
Keur SKKeur SK
hello,
I was also looking for the solution for this query I was also finding this issue for my site TechiesBlogging (https://techiesblogging.com/) ,somehow it's useful, thanks