Thanks Perry & John,
I'll give the Javascript method a go. The reason for wanting this functionality is to handle links (in previous EDM's and emails) and to retain any user bookmarks to the site. I understand SEO should not be an issue. Thanks for your help! Cheers, Simon. ________________________________ From: Perry Stathopoulos [mailto:[email protected]] Sent: Friday, 29 October 2010 1:04 AM To: [email protected] Subject: Re: Silverlight Deep linking and redirections I came across the same problem with my site. The inpage anchor hash (#) is client side thing, that only browser handles. Javascript is the only solution. This is the script I use: var s = window.location.protocol + '//' + window.location.host + '/#' + window.location.pathname; window.location.href = s; As to why you need this, is because of SEO. Google/Bing will not index urls with the hash. So I have my pages as http://domain.com/level1/level2 which are indexed in Google/Bing. This is an actual page, but if the user has Silverlight I redirect them with javascript to http://domain.com/#/level1/level2 . So my MVC urls match my Silverlight urls. Hope this helps, Perry From: John OBrien <mailto:[email protected]> Sent: Thursday, October 28, 2010 4:14 AM To: [email protected] Subject: RE: Silverlight Deep linking and redirections Simon, You are correct, the hash portion of the request is not sent to the server at all, no server side solution is going to solve this for you. The solution would be a small peice of javascript hosted on the domain you don't want people to use redirecting to the new domain. Let me know if you'd like me to find this script, I've used it before on some ajax sites. I am wondering why you need this functionality, the only scenario I can think of is that you have changed a domain name and need to redirect users with saved bookmarks to the new domain. Probably why others here havn't come across this before? John. ________________________________ From: [email protected] To: [email protected] Subject: RE: Silverlight Deep linking and redirections Date: Thu, 28 Oct 2010 11:40:15 +1000 I'm havn't tested the anchor Simon, pretty easy to test for you tonight if you like. Back to your solution to the problem, are you getting the anchor in your Request.Url.ToString()? Good post here from Rick explaining ASP.NET paths: http://www.west-wind.com/weblog/posts/132081.aspx 1st check the anchor is being set in that location header, fiddler is an awesome tool to check this, 2nd I guess check that this technique (301 redirect) supports anchors in all browsers. John. ________________________________ Subject: RE: Silverlight Deep linking and redirections Date: Thu, 28 Oct 2010 11:28:54 +1000 From: [email protected] To: [email protected] Thanks John, Do you know if this method will preserve the anchor (eg. #screen) or only the path/parameters? My current method preserves the path/parameters, but not the anchor. Simon. ________________________________ From: John OBrien [mailto:[email protected]] Sent: Thursday, 28 October 2010 11:09 AM To: [email protected] Subject: RE: Silverlight Deep linking and redirections Do you have the option to do this in IIS instead? IIS6/7 both have a simple mechnism to do the redirect and preserve the path/parameters. Do a quick search if this is an option, we use for the typical www redirections. ________________________________ Subject: Silverlight Deep linking and redirections Date: Thu, 28 Oct 2010 11:02:40 +1000 From: [email protected] To: [email protected] Hi all, Currently trying to setup some redirections on a Silverlight site that uses deep linking. I'm attempting to do this via a 301 redirect in the via the Global.asax. The issue is that the deep linking (anchors) gets lost with the redirection. Eg. Say we are attempting to redirect http://www.abc.com.au <http://www.abc.com.au/> to http://www.abc.com <http://www.abc.com/> . Attempting to navigate to http://www.abc.com.au/#screen <http://www.abc.com.au/#Page> is redirecting to the default page of http://www.abc.com <http://www.abc.com/> rather than http://www.abc.com/#screen . I can't see that the deep link (anchor) part is available from Global.asax, meaning I can't use it in the redirect. My redirection code in global.asax looks like this:- protected void Application_BeginRequest(object sender, EventArgs e) { if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("www.abc. com.au")) { HttpContext.Current.Response.Status = "301 Moved Permanently"; HttpContext.Current.Response.AddHeader("Location", Request.Url.ToString().ToLower().Replace( "www.abc.com.au", "www.abc.com")); } } Has anyone had experience with this or can point me in the right direction? Cheers Simon Hammer. _______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight _______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight ________________________________ _______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
_______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
