0

We built a site for a client to advertise a new block of apartments they had built. The apartments have now all been sold so we have been asked to forward the domain to another domain until there is a future use for it.

We have tried to do this by setting up a 301 redirect on our server - this works great for HTTP requests (both with and without WWW) but HTTPS requests fail. Can anyone offer us any tips?

here are the 2 web config files we have tried:

WEB CONFIG 1:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

 <rewrite>
  <rules>
    <rule name="Redirect to http" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        <add input="{REQUEST_URI}" pattern="(/\w*[/ | \w]+\.aspx)" />
    </conditions>
    <action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
    </rule>

  </rules>
</rewrite>

<location path="index.html">
    <system.webServer>
        <httpRedirect destination="https://WEBFORWARDINGDOMAIN.co.uk/" />
    </system.webServer>
</location>

WEB CONFIG 2

<?xml version="1.0" encoding="UTF-8"?>
 <configuration>
   <location path="index.html">
    <system.webServer>
        <httpRedirect enabled="true" destination="https://WEBFORWARDINGDOMAIN.co.uk/" childOnly="true" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>
 </configuration>
  • Paul, what are you seeing happening in your browser's developer tools - i.e., Console and Network tabs? – Trebor Jan 16 at 15:58
  • 2
    Do you have a security certificate? You need to get a certificate for HTTPS to work. It can be a free one from LetsEncrypt using their automated verification process. Or you can pay for one. – Stephen Ostermiller Jan 16 at 19:46
0

WEB CONFIG 1

change rewrite action url protocol to HTTPS and add new forwarding domain (redirects 1:1 -- http://old-domain.co.uk/link <> https://WEBFORWARDINGDOMAIN.co.uk/link)

<action type="Redirect" url="https://WEBFORWARDINGDOMAIN.co.uk{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />

or redirect all requests to https://WEBFORWARDINGDOMAIN.co.uk/ homepage

<action type="Redirect" url="https://WEBFORWARDINGDOMAIN.co.uk/" redirectType="Permanent" appendQueryString="false" />

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.