1

I have a Wordpress hosted on azure, that I have move from www.mydomain.com to old.mydomain.com,

on www.mydomain.com I make a new landing page that inform of what I want to inform and give a link to the "old" wordpress,

to avoid loosing seo (and keep wp info alive) I made the next web.config

<?xml version="1.0"?>
  <configuration>
    <system.webServer>
      <httpRedirect enabled="true" destination="http://old.mydomain.com" httpResponseStatus="Permanent" /> 
    </system.webServer>

    <location path="www.mydomain.com">
       <system.webServer>
            <httpRedirect enabled="false" />
        </system.webServer>
    </location>

</configuration>

redirect works perfectly, but it also redirect me www.mydomain.com to old.mydomain.com

How can I do it in web.config this no-redirect-the-root ??

I have try also the :

<location path="index.html">
    <system.webServer>
        <httpRedirect enabled="false" />
    </system.webServer>
</location>

but the result is the same, everything gets redirect to old.mydomain.com

1
  • sorry to disturb, no one seems to know if this is possible ? Commented Oct 10, 2016 at 19:54

1 Answer 1

1

You can try to use the Rewrite module of IIS, please consider the following configuration:

<configuration>
    <system.webServer>
    <rewrite>
          <rules>
            <rule name="Root rule" stopProcessing="true">
                <match url="^$" />
                <action type="None" />
            </rule>
            <rule name="redirect rule" stopProcessing="true">
                <match url="^(.*)$" />
                <action type="Redirect" url="http://www.example.com/{R:0}" appendQueryString="true" redirectType="Permanent" />
            </rule>
          </rules>
        </rewrite>
        </system.webServer>
</configuration>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot !! Your help was a light in the tunnel ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.