1

I'm using Rules and Detector module to prevent IE < 7.0 users from browsing the site.

I've setted up a rule, executed when UA (Detector) properties are loaded. Dependings on user agent value, the rule have an action, which consists in redirecting user to a particuler node (explanation).

This works well, so well that redirection is always active, even on my destination node. So it lead me to kind of 'Too much redirection error'.

I don't manage to put another condition, like Path has url alias; that will prevent all undesired redirections.

Do you know what I'm doing wrong? Please, don't hesitate to suggest me another way to achieve this redirection properly.

  • 1
    It's none of my business but it seems a bit harsh to exclude a whole section of users from your site based on using a browser that they might have no choice but to use. Many large corporates are stuck with legacy software because of the sheer cost of upgrading (until at least a year or so ago Sky Sports forced the use of IE6 internally for example), and you're alienating all of those. Why not take a softer, more educational approach, like that offered by the jReject module? Like I said, none of my business, but I think it bears consideration – Clive Jan 29 '13 at 15:29
  • Indeed it's an internal requierment. Legacies browsers MUST NOT evolve, because they deal with old sites/apps (IE 6 and 7), and this new site a full rebranding, which needs full CSS3 support. So, even if I'd general prefer to let users decide, in this case I really have to prevent and catch their attention :) – Jean-Rémy Revy Jan 29 '13 at 16:44
2

You might want to consider a simple redirect in .htaccess

To redirect based on user agent, if not already on redirected page.

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} MSIE [1-7]
RewriteCond %{REQUEST_URI} !^/upgrade/
RewriteRule .? upgrade [L]
  • Indeed, I did not even think about this ... I was focused on Drupal features ... Well it's not really what I'm looking for, but it would help me as a good workaround. Thanks to think outside of the box :) – Jean-Rémy Revy Jan 30 '13 at 22:06
0

I was not able, for mysterious reasons, to implement David Thomas solutions. So I decided to write a really dirty solution :

Assuming that I have an existing node with "upgrade" alias :

page.tpl.php

<!--[if lt IE 9]>

    <script type="text/javascript">
     if (window.location.pathname != "/upgrade") {
        window.location.pathname = "/upgrade"
     }
    </script>
<![endif]-->

Once again, it's quite dirty:

  • conditions are only available for IE
  • it's static and imply to deliver this additional code (would be quite better with configuration / module)
  • I must have and existing node (not too much important).

I'm really not proud of myself, but you know ... client is requiring this feature RIGHT NOW ! I hope I'll have time to found a better solution later (at least, it's planned).

0

Give this a try - not sure if it'll help in your case but it has worked for me.

Add /#r=off after every link in mobile that links to the main site (desktop);

i.e. http://yoursite.com/#r=off

This will direct you to your main site while preventing redirect back to mobile.

Hope this solves your problem.

  • Thanks for taking time quite a long moment after. Indeed it's a little bit far from my needs. – Jean-Rémy Revy Mar 15 '14 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.