I have a WP multisite that created the following web.config files at bottom ( works perfectly ). However, how do I create 301 redirects for individual pages in the subsites?

** WP generated web.config

                <rule name="WordPress Rule 1" stopProcessing="true">
                    <match url="^index\.php$" ignoreCase="false" />
                    <action type="None" />
                <rule name="WordPress Rule 2" stopProcessing="true">
                    <match url="^wp-admin$" ignoreCase="false" />
                    <action type="Redirect" url="wp-admin/" redirectType="Permanent" />
                <rule name="WordPress Rule 3" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
                    <action type="None" />
                <rule name="WordPress Rule 4" stopProcessing="true">
                    <match url="^(wp-(content|admin|includes).*)" ignoreCase="false" />
                    <action type="Rewrite" url="{R:1}" />
                <rule name="WordPress Rule 5" stopProcessing="true">
                    <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                    <action type="Rewrite" url="{R:2}" />
                <rule name="WordPress Rule 6" stopProcessing="true">
                    <match url="." ignoreCase="false" />
                    <action type="Rewrite" url="index.php" />


I want the page https://example.com/resources/a-story to go to https://example.com/mywork/a-story?

I've read this blog and it says I should be able to generate something like the snippet below it will crash the multisite:


 <location path="/resources/a-story">
      <httpRedirect enabled="true" destination="https://foo.com//resources/a-story" httpResponseStatus="Permanent" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.