Petrus Theron
Petrus Theron

Reputation: 28807

51Degrees redirect root only

How do I configure the 51Degrees <redirect> element as described in the documentation to only redirect requests made to the root address at http://mydomain.com/ to a mobile address (e.g. http://mydomain.com/m), but not requests made to any other addresses, e.g. http://mydomain.com/page123?

Upvotes: 3

Views: 756

Answers (2)

Chris B
Chris B

Reputation: 925

I currently work for 51degrees.mobi.

The documentation that you have pointed out in your question is old and is going to be moved. I'm sorry for the confusion. The current documentation for .NET can be found on our website.

To do what you need I suggest you set up a location rule and use the "origUrl" property. This is outlined here under section 2.1.2

Hope this helps.

Upvotes: 1

shakib
shakib

Reputation: 5469

This one worked for me

<redirect firstRequestOnly="false"
          mobileHomePageUrl="~/m"
          mobilePagesRegex="^~/\S+$">
</redirect>

any url matching mobilePagesRegex is considered mobile friendly and not redirected. "^~/\S+$" denotes anything other than "~/" (site root). So only site root is redirected.

Hope this helps.

Upvotes: 0

Related Questions