I have an old web application that’s being migrated to a different system, and I need to ensure that the existing URLs are redirected to the new system. (I’m using ASP.NET MVC2.)
Usually, I can just redirect to the homepage of the new site. However, if the URLs link to a specific item, they use an HTML bookmark as follows:
http://server/old-system/#itemID
I have a lookup file and translation function to go from an “itemID” to a redirect URL, and I can accomplish the redirection using a RedirectResult.
But how can I get the anchor tag to the server as a query string parameter (anchor tags aren’t sent in HTTP requests)? I assume I’ll need some kind of client-side javascript for this to invoke a separate server method, but I’m not sure how to do that translation.
(Note, the whole reason for doing this is that clients may have stored a bookmark link to an item.)
Thanks!
If
http://server/old-system/#itemIDis a page in your system you can do a quick translation in javascript.or get the value and link to another page.