title: ASP.NET URL rewriting and tag the old URL to 301
body: <p>Hi I'm trying to rewrite my url: www.mydomain.com/hw/Index.aspx to www.mydomain.com/hello-world/index.aspx . here is my code in web.config:</p>
  
  <pre><code>    &lt;rule name="Redirect to WWW" stopProcessing="true"&gt;
        &lt;match url="^hello-world/index.aspx" /&gt;
        &lt;action type="rewrite" url="hw/Index.aspx" /&gt;
      &lt;/rule&gt; 
  </code></pre>
  
  <p>the problem with this is I am having two Url with just the same page.</p>
  
  <ol>
  <li>www.mydomain.com/hw/Index.aspx</li>
  <li>www.mydomain.com/hello-world/index.aspx</li>
  </ol>
  
  <p>What I wanna do is when the user browse the <strong>www.mydomain.com/hw/Index.aspx</strong>
  it will be tagged as 301 and will redirect to <strong>www.mydomain.com/hello-world/index.aspx</strong></p>
  
  <p>Please help me.</p>
  
  <p>Thanks in advance.</p>