Catch All Redirect 
June 25th, 2009, 02:54 PM
| | Familiar Sight | | Join Date: Jul 2007
Posts: 180
| | |
We host personalized websites that are generated on the fly on a per campaign basis. Currently, when a campaign is over, we simply take down the site. Now, we are looking to have any post-campaign visitors directed to a generic page, "sorry we missed you..." Typically we will setup a subdomain for each campaign, something like subdomain.domain.com/firstname.lastname, so how can I get all of those personalized sites to direct to subdomain.domain.com/missed.aspx?
| 
June 25th, 2009, 02:56 PM
|  | Forum Leader | | Join Date: Apr 2008 Location: San Antonio, TX (USA)
Posts: 2,569
| | | re: Catch All Redirect
Just put a Response.Redirect in your default page's Page_Load method.
Example in C#: - Response.Redirect("http://bytes.com");
| 
June 25th, 2009, 02:57 PM
| | Familiar Sight | | Join Date: Jul 2007
Posts: 180
| | | re: Catch All Redirect
Are you saying that I would take down the original page, and just replace it with a page containing a simple redirect such as this?
| 
June 25th, 2009, 03:05 PM
|  | Forum Leader | | Join Date: Apr 2008 Location: San Antonio, TX (USA)
Posts: 2,569
| | | re: Catch All Redirect
You don't even really have to take it down, you could just add that line as the first line of code in the Page_Load method.
Or you could put a tag like this in the <head> section of your HTML: - <META http-equiv="refresh" content="0;URL=http://bytes.com">
Either way it is up to you.
I'm sure that there is a way to configure IIS to do the redirects for you, but I'm not an expert there.
| 
June 29th, 2009, 08:14 PM
| | Familiar Sight | | Join Date: Jul 2007
Posts: 180
| | | re: Catch All Redirect Quote:
Originally Posted by insertAlias You don't even really have to take it down, you could just add that line as the first line of code in the Page_Load method.
Or you could put a tag like this in the <head> section of your HTML: - <META http-equiv="refresh" content="0;URL=http://bytes.com">
Either way it is up to you.
I'm sure that there is a way to configure IIS to do the redirects for you, but I'm not an expert there. | This would be a way to redirect pages that exist, but what about pages that do not exist(404 errors). Given these are personalized pages that are generated on the fly, how would I handle those best?
Note-
I have attempted to setup web.config custom error pages for 404 errors, but redirects are not working properly. I have head that this method of redirects is very inconsistant.
| 
June 29th, 2009, 08:42 PM
|  | Forum Leader | | Join Date: Apr 2008 Location: San Antonio, TX (USA)
Posts: 2,569
| | | re: Catch All Redirect
Well, if you go into IIS, you can check the properties of a site, and set the custom error pages there. Maybe that will work for you.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|