Rate this article :
This article was useful to you ?
Yes
No
Vous avez noté 0 étoile(s)
Sommaire
Procédure
Service concerned: Windows ASP.NET Hosting
Panel concerned: Plesk
Level: intermediate
This help explains how [PERSON_NAME] the HTTP version of your site to its secure HTTPS version by adding a rule in the web.config file.
This method is intended for sites hosted on a Windows server with IIS. It can notably be used when your application requires a custom redirection rule.
To enable HTTPS redirection directly from Plesk, see the help: How do I set up an SSL certificate on a Plesk hosting plan?
This help concerns only Windows hosting using Plesk.
Are you using another environment?
Check that your SSL/TLS certificate is installed and that your site displays correctly when you enter its address directly in https://.
The certificate must cover the address used by your visitors, in particular the domain with or without www.
Also download a copy of your web.config file before modifying it. This will allow you to restore it quickly if the site no longer displays after the change.
The rule presented in this help creates a permanent 301 redirect. It may be cached by the browser.
Only enable this redirection after verifying that your site works correctly in HTTPS.

httpdocs folder.
web.config file.
[PERSON_NAME] web.config does not exist in the [ADDRESS] site folder, you can create one.

The web.config file uses XML format. A missing tag, a tag that is not properly closed, or one placed in the wrong location can cause a 500 error and prevent the site from displaying.
The modification to make depends on the current content of your web.config file.
Add the following content:
Then save the file.
Do not create a second or section.
Only add the following rule inside the existing section, before the closing tag:
The rule name must be different from that of the other rules already present in the file.
Make sure that no other rule in the web.config file or in your application is already redirecting the site to HTTPS. Several active redirects at the same time can cause a loop.
Open a private browsing window, then enter your site address starting with http://.
For example:
http://votredomaine.fr
The browser should automatically display:
https://votredomaine.fr
Also test an internal page:
http://votredomaine.fr/contact
[PERSON_NAME] in HTTPS:
https://votredomaine.fr/contact
[PERSON_NAME] also test the version [PERSON_NAME] www if it is used by your site.
The redirection works if addresses starting with http:// automatically switch to the same page in https://, without a security warning.
If your site no longer displays after saving:
web.config file with the copy downloaded before making the change.
If you only added the rule in an existing section, [ADDRESS] starting with:
and ending with:
Then save the file and test your site again.
My site displays a 500 error
The web.config file probably contains a syntax error or a duplicate section.
Restore the backup copy, then check:
section; section; or section.The browser displays a redirection loop
Another HTTPS redirection is probably already active.
Check:
web.config file;Keep only one redirection method when possible.
[PERSON_NAME] then the site in a private browsing window so that an old redirect cached by the browser does not distort the result.
The site remains accessible over HTTP
Check that the web.config file is located in the root folder of the correct site. This is usually the httpdocs folder, but a secondary domain may use another folder.
Also check that is present and that the file has been saved.
A security warning appears after the redirect
The redirection works, but the SSL/TLS certificate is not valid for the requested address.
Check that the certificate:
www if it is used;The padlock does not appear even though the site is in HTTPS
Some resources on the site, such as images, scripts, or stylesheets, are probably still being loaded with an address starting with http://.
The redirection does not automatically modify the links saved in your site. You must correct these addresses in your CMS, your database, or your application files.
Rate this article :
This article was useful to you ?
Yes
No
0mn reading
How do I create an FTP user in Plesk?
3mn reading
How do I change the FTP password in Plesk?
13mn reading
How do I install a CMS from Plesk?
0mn reading
FTP connection problem: Error 530 User cannot log