Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stephen Kiers 41 posts 62 karma points
    Aug 02, 2010 @ 08:04
    Stephen Kiers
    0

    Using alttemplate based on hostnamesettings

    I understand how alttemplate can work, and think it is brilliant, however I would like to have the template used to be decided by the subdomain of the

    Regular template
    http://domain.com/pagename.aspx
    &
    http://www.domain.com/pagename.aspx

    iPhone template
    http://i.domain.com/pagename.aspx

    Regular Mobile template
    http://m.domain.com/pagename.aspx

    Suggestions?

  • Sebastiaan Janssen 5017 posts 15339 karma points MVP admin hq
    Aug 02, 2010 @ 08:11
    Sebastiaan Janssen
    0

    I think the altTemplates have been removed from your URL's here. But anyway, you could easily do this by using a url rewrite, check out the /config/urlrewriting.config for a little bit of an example. If you need help constructing a rewrite rule then just shout here and I'll see what I can come up with.

  • Soeren Sprogoe 575 posts 259 karma points
    Aug 02, 2010 @ 09:41
    Soeren Sprogoe
    1

    urlrewriting.config is definately the way to go.

    If you want a more advanced option, then I can recommend ISAPI Rewrite. It can fx. look at the user agent string, and append a ?alttemplate=xxx to the query. Not sure if the build in urlrewriting.config can do that.

    /SoerenS

  • Tim 1193 posts 2675 karma points MVP 2x c-trib
    Aug 05, 2010 @ 13:14
    Tim
    0

    Soeren's right, if you need more advanced detection based on the user agent, then ISAPI Rewrite is much better, as UrlRewriting.Rewrite only supports basic rewriting rules, and doesn't check the user agent at all. If you only want to do it based on the domain, then you can do that with the basic UrlRewriting.Rewrite config file.

Please Sign in or register to post replies

Write your reply to:

Draft