Saturday, July 30, 2022
HomeWordPress Developmenturl rewriting - IIS URL Rewrite not redirecting pages

url rewriting – IIS URL Rewrite not redirecting pages


Background:

I’m making an attempt to redirect pages from one WordPress website to a different, the reason is the corporate is rebranding so the previous website has the previous identify and the brand new website has the brand new identify and we wish to be sure that guests are redirected to the brand new website/branding in the event that they go to the previous website.

The websites are on Home windows Server 2019 servers with IIS and I am utilizing the URL Rewrite module which I usually have no points with.

Difficulty:

The redirect is totally ignored after I browse to the previous website utilizing a URL I do know needs to be redirecting i.e. https://theoldsite.co.uk/about-us

<rule identify="Check" stopProcessing="true">
<match url="about-us" />
<situations logicalGrouping="MatchAll" trackAllCaptures="false" />
<motion sort="Redirect" url="https://thenewsite.co.uk/aboutus" />
</rule>

The entire net.config file appears to be like like this:

<?xml model="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <guidelines>
                <clear />
                <rule identify="WordPress: http://theoldsite.co.uk" patternSyntax="Wildcard">
                    <match url="*" />
                    <situations logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add enter="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add enter="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </situations>
                    <motion sort="Rewrite" url="index.php" />
                </rule>
                <rule identify="HTTPS" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="*" />
                    <situations logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add enter="{HTTPS}" sample="off" />
                    </situations>
                    <motion sort="Redirect" url="https://{HTTP_HOST}{REQUEST URI}" redirectType="Discovered" />
                </rule>
                <rule identify="Check" stopProcessing="true">
                    <match url="about-us" />
                    <situations logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <motion sort="Redirect" url="https://thenewsute.co.uk/aboutus" />
                </rule>
    </guidelines>
    </rewrite>
  </system.webServer>
</configuration>

Is there some voodoo occurring in WP, possibly one thing to do with the Permalinks?

Any assist gratefully obtained.

Rob

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments