Link to home
Start Free TrialLog in
Avatar of sunny-j
sunny-j

asked on

permanent 301 redirects using ASP.NET MVC

Is this the best way of redirecting pages (permanent 301 redirects) from the old location of the domain to a new site (same domain) within  ASP.NET MVC using c# or should i be creating list within a controller?

 <system.webServer>
   

    <rewrite>
      <rules>
        <rule name="Name of page" stopProcessing="true">
          <match url="^Consultants.cshtml$" />
          <action type="Redirect" url="/Home/About" />
        </rule>
        <rule name="New rule" stopProcessing="true">
          <match url="^Consultants.cshtml$" />
          <action type="Redirect" url="/Home/About" />


        </rule>
      </rules>
    </rewrite>
  </system.webServer>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Daniel Reynolds
Daniel Reynolds
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sunny-j
sunny-j

ASKER

Thanks Daniel, thanks for comment. For this project, i was going to use azure so not sure if i have direct access to the IIS. Do you think it could still be done within an ASP.NET MVC project ?
Sorry, other than just doing a re-direct in the page, I have not done it the way you are thinking of.