ASPNetFAQ.com: What is ASP.NET?

Technology posts on ASP.NET, IIS, Windows (+ a little Linux), Cloud Servers, Hosting, and more!
  • Blog Home
Search the site...

URL Rewrite 301 Redirect For a Single Page

Tweet
Share
0 Shares

Want to set up a 301 redirect for a certain single page on your site to send users to a different URL?

Below is a very simple web.config file I created on an IIS7 server to demonstrate performing this action. The rule looks for a URL of http://<yourdomain.com>/folder1/default.aspx and, if found, returns an HTTP Status code of 301 and then sends users instead to the URL of http://www.TheDestinationSite.com.

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”RedirectSingleURL” patternSyntax=”ExactMatch”>
<match url=”folder1/default.aspx” />
<action type=”Redirect” url=”http://www.TheDestinationSite.com/” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

This sample should work on a site hosted on any version of IIS7 or higher, like the Managed Windows Hosting plans over at OrcsWeb or the Discount Windows Hosting plans at Cytanium.

Happy hosting!

More from my site

  • Resolving a “There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined” ErrorResolving a “There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined” Error
  • Orchard: Custom Content in Sub-FoldersOrchard: Custom Content in Sub-Folders
  • Log Parser: Pulling Valuable Data From IIS LogsLog Parser: Pulling Valuable Data From IIS Logs
  • IIS7 Mime MappingsIIS7 Mime Mappings
  • Using URL ReWrite to host multiple sites/domains under a single siteUsing URL ReWrite to host multiple sites/domains under a single site
Tweet
Share
0 Shares
cytanium, Development/Coding, Hosting, IIS, OrcsWeb, tip, Windows

Comments are closed.

Proverbs 19:20

"Get all the advice and instruction you can, so you will be wise the rest of your life."

A Note On WordPress Hosting

Our main focus is of course .NET, but with a mix of Linux, virtualization, and other technologies. But if you're really looking for the best WordPress hosting specifically, read my WordPress host review to save yourself hassle AND money!




Recent Posts

  • What makes good web hosting?
  • jQuery Mobile C# ASP.NET and N5 Networks Software Repository
  • Open Source Bug Tracking Software and the Orchard Project
  • ASP.NET Development with Dreamweaver MX: Visual QuickPro Guide
  • Kendo UI Sample, ASP.NET Ajax Tutorial & More

Tags

.NET ASP.NET Automation blog centos cloud CMS css cytanium Development/Coding Email gmail Hosting htaccess IIS javascript Learning Linux logparser MVC MySQL Orchard OrcsWeb performance PHP PowerShell redirect RHEL security server SherWeb smtp SQL/Databases System Administration tip Troubleshooting Ubuntu virtualization Visual Studio web farm web hosting WebMatrix Windows windows server Wordpress

Categories

  • ASP.net development
  • Development/Coding
  • Hosting
  • IIS (Internet Information Services)
  • SQL/Databases
  • System Administration
  • Virtualization
(c) ASPNETFAQ.com