473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Catch All Redirect

233 100+
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?
Jun 25 '09 #1
5 3524
Curtis Rutland
3,256 Expert 2GB
Just put a Response.Redirect in your default page's Page_Load method.

Example in C#:
Expand|Select|Wrap|Line Numbers
  1. Response.Redirect("http://bytes.com");
Jun 25 '09 #2
mcfly1204
233 100+
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?
Jun 25 '09 #3
Curtis Rutland
3,256 Expert 2GB
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:
Expand|Select|Wrap|Line Numbers
  1. <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.
Jun 25 '09 #4
mcfly1204
233 100+
@insertAlias
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.
Jun 29 '09 #5
Curtis Rutland
3,256 Expert 2GB
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.
Jun 29 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Craig | last post by:
Can you put a Response.Redirect inside a Try Catch block? I think you will get a thread Abored Error, true?
7
by: Arjen | last post by:
Hi, I'm doing this: try { try { } catch(Exception ex){ throw;
5
by: Tim | last post by:
Hello, I've noticed that sometimes putting a Response.Redirect in a Try-Catch will itself throw an exception due to a threading violation. However, in some cases it works, in others it doesn't, and...
2
by: Dan | last post by:
hi ng, i have a problem with windows authentification. i want to forward every user who 1. is not authorized 2. or could not be authenticated to a login page -------------------
6
by: Alfredo | last post by:
Hi, I have question, i debug this code: try 'Some operations catch Response.Redirect("Page 1") finally Response.Redirect("Page 2")
3
by: Enter The | last post by:
how can i replace try{ if (!$facebook->api_client->users... { $facebook->redirect($facebook-... } catch(Exception $e) { //this will clear cookies for your app and redirect them to a login prompt...
6
by: Dave | last post by:
I really don't like the users getting an unhandled expception page, and I'm still to new with ASP.Net and C#. So please accept my appology for the 2 part question. SqlException (0x80131904) ...
3
by: randy.buchholz | last post by:
I am trying to capture event exceptions using try/catch. I can get all exceptions with: protected void dv_PR_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception !=...
16
by: HillBilly | last post by:
This is freaking me out. I'm using Membership and trying to determine if the database is online. The GetConnectionString( ) method returns a connection string as expected but not when used in the...
5
by: rote | last post by:
I'm using ASP.NET 2.0 and i have copied and pasted the code below to my Global.asax file but it desn't trap the error I want to trap the 401 access denied void Application_Error(object sender,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.