CONTACT US: 1-800-622-4403
ABOUT    CONTACT SALES    SERVICE AREAS
Domains To Datacenter Since 1994

Using a Web.Config Redirect

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" />


Websites

  1. How To Install WordPress
  2. Hosting Multiple Domains on One IP Address (SuperAccount)
  3. How to modify CSS on Mobile Devices
  4. Change Your Domain Name using WordPress
  5. How to enable .NET 4.0 for your POA Account.
  6. How to remove Pages/Posts from Wordpress Search
  7. How to disable all Wordpress plugins using MySQL
  8. Remove index.php from Wordpress URL
  9. How to move a Drupal site from one host to another
  10. How to move a Wordpress site from one host to another
  11. How to change the Wordpress site URL
  12. Masking Your Email from Spammers with WordPress + PHP
  13. How to Redirect a Registered Domain
  14. Changing the Wordpress URL Path to web root "/" or another path
  15. Simple Way to Secure a WordPress Website
  16. How to restart your website in Control Panel.
  17. How to Block Referral SPAM from your Website
  18. Creating Campaigns in Google Analytics
  19. Switching over to a New InfoQuest account.
  20. Stopping your website through the customer control panel.
  21. Deleting a domain from your account.
  22. Where do I go to view my web stats (AWStats) for my site?
  23. How to change Wordpress siteURL to IP address using phpmyadmin
  24. How to enable "anonymous access" to browse my site.
  25. How to access Wordpress files.
  26. How to add a dedicated/exclusive IP address to your account.
  27. How to upload website content to the server.
  28. Update Directory Path for Website.
  29. Password protecting a folder on your site on POA.
  30. Add Structured Data Location Schema to your website
  31. How to delete WordPress Comments using phpmyadmin
  32. How to password protect a specific directory on your POA Hosting Account.
  33. What's New in Wordpress 4.9
  34. Adding A Domain To My Account. (POA)
  35. Using a Web.Config Redirect
  36. Using CDOSYS with POA accounts without authentication
  37. Permanent 301 redirect
  38. Using CDOSYS with POA accounts with authentication

Feedback and Knowledge Base