The Javascript approach to rewrite rules



  • From the new website of our largest national supermarket (here in the Netherlands):

    if (location.href.toLowerCase().indexOf(("www.ah.nl")) != -1)
    {
    	location.href="http://www.ah.nl";
    }
    else if (location.href.toLowerCase().indexOf("www.wordeenhamster.nl") != -1)
    {
    	location.href="http://www.ah.nl/wordeenhamster";
    }
    else if (location.href.toLowerCase().indexOf("www.wordteenhamster.nl") != -1)
    {
    // skip 400 lines
    else
    {
    	location.href="http://www.albert.nl";
    }//-->
    


    See for yourself at http://ah.nl (disable javascript)



  • I think rewrite rules are stupid anyway. Maybe this programmer was making an ironic commentary on the vanity in web development?



  • @savar said:

    I think rewrite rules are stupid anyway. Maybe this programmer was making an ironic commentary on the vanity in web development?

    Sadly, I don't think so. The remainder of the site is a convoluted WTF of javascript 'framework'. It even relies on javascript for basic page layout. To top it off this 'framework' seems to rely on user agent string based browser detection.

    The website simply reeks of 'incompetent web monkey'.



  •  @savar said:

    I think rewrite rules are stupid anyway. Maybe this programmer was making an ironic commentary on the vanity in web development?

    Rewrite rules are stupid, but huge, ugly query strings are even stupider.

    <font size="-1">Tim Berners-Lee, or somebody like that, made a pretty good point about how good URLs are descriptive, and permanent.  Can't find it now...  But at any rate, rewrite rules are an attempt at making that philosophy a reality.</font>



  •  www.wordteenhamster.nl

     I am having a hard time reconciling this domain with a supermaket chain. I'd look and see but I'm afraid its NSFW ... ([url=http://www.google.com/search?q=wordteenhamster&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a]searching google for it[/url] just leads here)



  • @merreborn said:

    <font size="-1">Tim Berners-Lee, or somebody like that, made a pretty good point about how good URLs are descriptive, and permanent.  Can't find it now...  But at any rate, rewrite rules are an attempt at making that philosophy a reality.</font>

     

    Found it:  "Cool URIs don't change"

    Tim Berners-Lee, 1998

     

    And that's why people use rewrite rules. 



  • @medialint said:

     www.wordteenhamster.nl

     I am having a hard time reconciling this domain with a supermaket chain. I'd look and see but I'm afraid its NSFW ... (searching google for it just leads here)

     

    404


Log in to reply