Redirecting dymanic url which no longer exists to a different page in asp.net 2.0 using C#

We have some products in our website which longer exists and the person who sets up the products deleted them. The Site is build in asp.net 2.0 and C# and the product url are generated dynamically from the SQL database.

I am wondering if some of these urls can be redirected to new products.

for example I have a url like
http://www.mysite.com/browse/ensemble.aspx?cid=17&eid=560&bid=3&pgid=1&gid=-1&sid=-1

Open in new window


which should be redirected to

http://www.mysite.com/browse/product.aspx?cid=66&pid=1739&bid=3&pgid=5&gid=-1&sid=-1

Open in new window


Thanks and appreciate it
LVL 2
niceoneishereAsked:
Who is Participating?
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
Sounds like a great big mess in the making.
You really should correct your database - else you have a database to maintain, patch code to maintain and a list of retired products to maintain.

>>my problem of some of our suppliers have linked these products in their websites.

But you say the product doesn't exist anymore - they should be informed of that.  Someone at their end will be maintaining their website, complete with incorrect and out of date info.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Would it not be MUCH better to update the database with the correct information rather than put a crude patch in place ?
0
 
niceoneishereAuthor Commented:
thought about it but the URL will still exists correct so i thinking it will still throw the 404 error. my problem of some of our suppliers have linked these products in their websites.

I am trying to do this without having to ask them to change the urls from their end.

Thanks
0
 
niceoneishereAuthor Commented:
I think you are correct, I am noticing a lot of things thats would make this a huge mess. I will start correcting the database. hopefully it wont screw things more.

Thanks
0
 
niceoneishereAuthor Commented:
thanks for the advice
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.