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

    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

    iPhone template

    Regular Mobile template


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

    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

    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.


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

    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: