.htaccess referrels, I'm a little lost

Discussion in 'HTML & Website Design' started by AFuddyduddy, Dec 18, 2010.

  1. #1
    Ok, here's the skinny...

    I've got a main domain and a subdomain. the main domain is a portal page, the subdomain is where the action is and is php driven. On the portal page I have a very basic redirect up that works just fine written in html and nothing else. If someone goes direct to the meat with just the url (http://subdomain.domain.com/, no "/index.php" at the end of it gets hit with the index.html in that hosted folder by default, which throws them at the portal page... which then in turn throws them back to http://subdomain.domain.com/index.php specifically.

    Here is my issue. I want folks that are referred by or going directly via to http://subdomain.domain.com/index.php to still be redirected to the portal page.

    If Joe Schmoe happens upon a link for www.domain.com and clicks.. no problem, they get portal page and all is well.

    If Joe Schmoe clicks on a link or bookmark for www.subdomain.domain.com/ again, all is fine..

    BUT, if Joe Schmoe clicks a link or has a bookmark for www.subdomain.domain.com/index.php .... Joe totally bypasses my portal page.

    .htaccess with referrers seems to be the answer.. but I can't for the life of me figure out what I need to do. so if Joe does click on the link or bookmark, he didn't come from www.domain.com directly.. gets redirected.. THEN can come back to www.subdomain.domain.com/index.php with a proper referrer of http://(www)domain.com

    Um.... help?
     
    AFuddyduddy, Dec 18, 2010 IP
  2. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #2
    Why not just set a cookie when someone visits your portal, and check for it when someone visits your portal, and if they have the cookie automatically redirect them?
     
    shofstetter, Dec 18, 2010 IP
  3. AFuddyduddy

    AFuddyduddy Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Mostly because it's a community driven site. We've been around for quite a while, but lately donations to keep things up and running haven't been coming in as normal, yet the usage has gone up. So I just want a quick 6 second "ambush" to get donations coming back in to keep the site going.

    It's ethically questionable I suppose... but it's only doing it from our site.... we don't advertise anything on the site but what the community provides. no banner clicks, pop-up ads, etc.... It basically says " Wanted to say Thanks to those who donated. And if you haven't had a chance, click here" with an option to go immediately to the site... that all works great! It's just I want my index.php to be accessed by referred only from my main domain.

    If the traffic were slowing with the donations, I'd understand.. but traffic has gone up.. and has continued to rise at a steady pace. I don't want to advertise, but I don't want to pay out of my own ass to keep this site going either. I think a 6 second reminder to click on a link and donate a buck or two is warranted under the circumstances.

    I'd really have no problem if I could screw with the index.php. But it's a BB forum and any changes in that breaks the forum, no solution there. Otherwise I would rename it and change links site wide, and just stick it in there.
     
    Last edited: Dec 18, 2010
    AFuddyduddy, Dec 18, 2010 IP