I have a web.config file that I use to redirect specific pages for SEO reasons.

I want to redirect the content of one folder www.sample.com/pro/bcn to another folder www.sample.com/pro/barcelona on the same site, But I don't know how.

<configuration>
   <system.webServer>      
       <httpRedirect enabled="true" exactDestination="true"  httpResponseStatus="Permanent">
           <add wildcard="/forms/newsconfirmH.htm destination="/forms/NewsletterformH.htm" />
      </httpRedirect>       
   </system.webServer>
</configuration>

Please help.

link|improve this question
feedback

1 Answer

Make sure that HTTP Redirection is installed on your server. It is not available on the default installation of IIS 7. To install it, use the following steps (Windows Server 2008 or Windows Server 2008 R2):

  1. On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
  2. In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
  3. In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
  4. On the Select Role Services page of the Add Role Services Wizard, expand Common Http Features, select HTTP Redirection, and then click Next.

Then, put this in the web.config in the folder /pro/bcn

 ...
 <system.webServer>
    <httpRedirect enabled="true" destination="http://www.sample.com/pro/barcelona" />
 </system.webServer>
 ...
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.