The IONOS help here https://www.ionos.co.uk/help/ssl-certificates/tips-for-setup-and-use/automatically-redirect-visitors-to-ssl-secured-site/ tells me to do the following:
Steps for Windows Packages Open a basic text editor, such as Notepad (Windows) or TextEdit (MacOS). Copy and Paste the code below into the text editor.
<%EnableSessionState=False
host = Request.ServerVariables("HTTP_HOST")
if host = "example.com" or host = "www.example.com" then
response.redirect("https://www.example.com/")
else
response.redirect("https://www.example.com/error.htm")
end if
%>mixed
In the text editor, replace all instances of "example.com" with your own domain. Save the file as index.asp. Upload the File via FTPS to the root of your webspace.
But if I do this, I get an ERR_TOO_MANY_REDIRECTS error message when I type in the address of the website. It tells me to cleardown cookies, which I have done, but that makes no difference. Plus other devices - other PCs, laptops and phones have the same problem.
I made sure there is an error.htm page.
The SSL certificate is valid and there is no problem if you type in the address preceded by https:// - BEFORE implementing OR AFTER reversing the IONOS advice.
I just want is to automatically go to the https version - even if you do not prefix the address with https://.
I have tried editing the web.config but it seems I cannot get this right. - have tried this code for example. Amended to my web address of course.
<rewrite>
<rules>
<rule name="Force HTTPS" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
And get this error:: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.
Also tried this - no luck:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<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>
</rules>
</rewrite>
</system.webServer>
</configuration>
My homepage is index.htm so I thought it was strange that the Ionos code recommends creating a .asp page to? But what do I know ---- not much apparently.
Ionos will not help - they say it is outside of their scope.