Solved

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

Posted on 2011-09-19
5
324 Views
Last Modified: 2013-11-07
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
0
Comment
Question by:niceoneishere
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 36559993
Would it not be MUCH better to update the database with the correct information rather than put a crude patch in place ?
0
 
LVL 1

Author Comment

by:niceoneishere
ID: 36560004
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
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 36560101
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
 
LVL 1

Author Comment

by:niceoneishere
ID: 36560153
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
 
LVL 1

Author Closing Comment

by:niceoneishere
ID: 36588243
thanks for the advice
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now