InfoQuest Knowledgebase InfoQuest Knowledgebase

  • Home
  • Knowledgebase
    • Billing
    • Control Panel
    • Data Center
    • Databases
    • Domains
    • Email
    • FTP
    • Hosted Exchange
    • SSL Certificates
    • Virtual Private Servers
    • Webmail
    • Website Hosting
  • FAQ
  • Contact
  • Visit InfoQuest.com
Home / Website Hosting / Using a Web.Config Redirect (POA)

Using a Web.Config Redirect (POA)

Here is an example code of how to do a redirect using a web.config file.

web.config 301 redirect

This example will redirect single pages to a new location.

Let say the new pages of your site have .html extensions and you want the new location to be its own directory

(IE. http://yourdomain.com/services.html will change to http://yourdomain.com/sales/).

  1. Open web.config in the directory where the old pages are located.
  2. Add code for the old location path and new destination:
<configuration>
<location path=”sales.html”>
<system.webServer>
<httpRedirect enabled=”true” destination=”http://yourdomain.com/sales” httpResponseStatus=”Permanent” />
</system.webServer>
</location>
<location path=”inventory.html”>
<system.webServer>
<httpRedirect enabled=”true” destination=”http://yourdomain.com/inventory” httpResponseStatus=”Permanent” />
</system.webServer>
</location>
</configuration>

You can add as many location paths as necessary.

The other example will redirect an entire directory to a new location.

For example, if you want http://yourdomain.com/dir-old/ redirected to http://domain.com/new-directory/ open web.config in /dir-old, then add the following line of code within the <system.webServer> section:

<httpRedirect enabled=”true” destination=”http://yourdomain.com/new-directory” httpResponseStatus=”Permanent” />

Website Hosting

Related Articles

  • Professional Services
  • iframe Dynamic Height Script
  • Where do I go to leave positive feedback for support?
  • Improving Website Performance

Knowledgebase Categories

  • 7Billing
  • 50Control Panel
  • 4Data Center
  • 4Databases
  • 12Domains
  • 58Email
  • 4FTP
  • 38Hosted Exchange
  • 7SSL Certificates
  • 25Virtual Private Servers
  • 5Webmail
  • 47Website Hosting

Most Helpful Articles

  • How to change WordPress siteURL to IP address using phpmyadmin (POA)
  • Remove index.php from WordPress URL (POA)
  • How To Setup An Archive Folder in Outlook for MAC (POA)
  • How to Redirect a Registered Domain (POA)
  • Share Exchange Outlook calendar on iOS devices (POA)
  • Changing the WordPress URL Path to web root “/” or another path (POA)
  • Where do I go to leave positive feedback for support?
Copyright © 2020 - InfoQuest Technologies, Inc.