301 Redirect catre www.domeniu.ro

ASP.NET
Se poate face acest tip de redirectare folosind codul de mai jos in fisierul web.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
   <rewrite>
      <rules>
        <rule name="Redirect to WWW" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^example.com$" />
          </conditions>
          <action type="Redirect"
                  url="http://www.example.com/{R:0}"
                  redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Add Feedback