The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Redirect index.html only once

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #41577

    Hello forums :),

    I have one little problem regarding **htaccess redirects**. Basically what I’m trying to do is redirect **index.html** to a different html file/folder (**christmas.html** or /christmas for example). That works well but the thing is that I want to show this page only once. When someone visits the page they are redirected to christmas subfolder with a little Merry Christmas wishing and a link to return back to the website (main index.html).

    And here is the problem because when they click the link pointing to main index.html, it of course redirects them back to the christmas subfolder and then over again. Is there a way to fix this and only redirect them the first time? Or some other way to make this work?

    Thanks in advance,
    I wish you all Merry Christmas :)


    I’m not sure about this but you may want to look into document.referrer

    What this does is if anyone came from, redirect them to site2.html.

    var ref = document.referrer;
    if(ref && ref.toLowerCase().indexOf(“”)!==-1){


    How could I apply this to my example?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Other’ is closed to new topics and replies.