I’m using the 51degrees API for mobile redirection: http://51degrees.codeplex.com/
- The desktop site is located at http://www.mydomain.com.
- The mobile site is located at http://m.mydomain.com.
When a mobile device is detected, using 51degrees, I am able to redirect from from any desktop page to the mobile homepage using the 51degrees configuration only. I.e. http://www.mydomain.com/somepage to http://m.somepage.com/default.
What I am unable to do is redirect to the same page, i.e. from http://www.mydomain.com/somepage to http://m.somepage.com/somepaage.
Is it possible to redirect to the same page?
Option 1: Use 51degrees for the mobile detection part only and wire up the redirect yourself. Remove the
<redirect>element from your web.config and try something like this in your Global.asax file:Option 2: In the
<redirect>element in the web.config file, add the propertyoriginalUrlAsQueryString=true. This will send a query string called origUrl to the mobile homepage giving you the option to redirect to the mobile version of the requested page.