User283571144 posted
Hi michaelcode,
no I don't have access to IIS, that's why I'm trying to do it in the web.congif file.
any ideas?
According to your description, I suggest you could try to add url rewrite config in web.config file.
I suggest you could add below config codes inside <system.webServer>.
Notice:Paste the following code at the new line, replacing [RULE NAME], [OLD URL] and [NEW URL] with the appropriate information (see Rule Variations below). When putting in the [OLD URL], don't include the http:// as that will not work.
<rewrite>
<rules>
<rule name="[RULE NAME]" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_HOST}{REQUEST_URI}" pattern="[OLD URL]" />
<add input="{HTTP_HOST}{REQUEST_URI}" pattern="www.[OLD URL]" />
</conditions>
<action type="Redirect" url="http://[NEW URL]" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
More details about how to create url rewrite rule, I suggest you could refer to below codes:
https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference
Best Regards,
Brando