Prima paginaLiveHosting WebsiteForumBlog
Language
 
Home>Knowledge Base>ASP.NET>301 Redirect catre www.domeniu.ro
User Login
Username
Password
 
 Login
Information
Article ID227
Created On9/9/2011
Modified9/9/2011
Share With Others

301 Redirect catre www.domeniu.ro

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>