1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Just saw this in someone's .htaccess file

Discussion in 'General Programming Chat' started by OTrap, Oct 21, 2010.

  1. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
    I know nothing about programming, but this guy's .htaccess file looks nothing like any of mine. It has the following, over and over, with one little change.

    Code:
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^hisdomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.hisdomain.com$
    RewriteRule ^league/$ http://some-affiliate.com/link1/ [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^hisdomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.hisdomain.com$
    RewriteRule ^league/$ http://some-affiliate.com/link2/ [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^hisdomain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.hisdomain.com$
    RewriteRule ^league/$ http://some-affiliate.com/link3/ [R=301,L]

    What does all this do?
     
  2. Codythebest

    Codythebest Senior Member

    Joined:
    May 29, 2009
    Messages:
    1,138
    Likes Received:
    880
    Location:
    Fuerteventura
    Home Page:
    I made a search online and found out that this happens time to time. Last time seems to be about 8 months ago and those backlinks were back after a couple of days. Not sure why. But the explanation was that yahoo cleaned its own "weaker" backlinks and all those pages that are not existing anymore but still indexed.
    Got that from the Search Engine Journal.
     
  3. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
    That's weird. HIS site is still up. I'm in his cPanel (with permission).
     
  4. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
    Could this, at all be CSing? The affiliate links are all Clickbank, so I got to thinking that something like this might be.

    Yay? Nay?
     
  5. sheppardzwc

    sheppardzwc Newbie

    Joined:
    Oct 21, 2010
    Messages:
    15
    Likes Received:
    0
    Looks like he's redirecting his site to go to an affiliate site. That's what a 301 redirect is.
     
  6. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
    But when you go to his URL, it shows up like it always has.
     
  7. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    All that means is that if you were to go to http://hisdomain.com/league/ or http://www.hisdomain.com/league/ you would be redirected to http://some-affiliate.com/link1/.

    Doesn't seem to make a lot of sense repeating the RewriteRule like that. I think apache would just use the first rewite rule it found in the .htaccess that matches that pattern (^league/$) and go with the approprite substitution (http://some-affiliate.com/link1/). Any other rules below that with the same pattern would be ignored.
     
  8. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
    Weird, though, because it doesn't redirect. If you go to his domain, it stays at his index.html page.
     
  9. extremephp

    extremephp BANNED BANNED

    Joined:
    Oct 19, 2010
    Messages:
    1,293
    Likes Received:
    1,272
    And Did you try accessing the league Folder?

    As Far as I know, It is a MAth type of Redirection, And It Randomly Redirects to Link1 link2 and Link3 Instead of redirecting only to a single page!!

    Try accessing League Folder :)

    ~ExP~
     
  10. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    Except apache wont just randomly pick a rule like that. It will go with the rule at the top of the file (the first one to match the pattern "league") and redirect to that link every time.

    In practice that exact code should work fine. http://www.hisdomain.com/league/ should 301 to http://some-affiliate.com/link1/ every time.
     
  11. kunalagg

    kunalagg Newbie

    Joined:
    Sep 19, 2010
    Messages:
    14
    Likes Received:
    0
    hey otrap, how u entered inside his cpanel ?
     
  12. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
    kunalagg, I'm a friend of his. It was with his permissions.
     
  13. GreyWolf

    GreyWolf Executive VIP Jr. VIP

    Joined:
    Aug 17, 2009
    Messages:
    1,930
    Likes Received:
    5,389
    Gender:
    Male
    Occupation:
    Artist / Craftsman
    Location:
    sitting at my PC
    It's like Grizzy and extremephp said. The redirect is for the folder /league/. If you go to the main domain or any other subfolder it isn't going to redirect.

    It looks like they want it to do like extremephp suggests, or maybe they want something like /league/1 would redirect to Link1, /league/2 redirect to Link2, etc.
    The way it's written though it seems it would always just go to the first rule like Grizzy suggests.

    If it's your friend, why don't you just ask what he's trying to do? :cheers2:

    If it's a good friend then maybe even help him check if it's working right. :cool:
     
  14. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
    Maybe tomorrow. He's not in a proper frame of mind to discuss business this evening, if you catch my drift.
     
  15. wannabie

    wannabie Elite Member

    Joined:
    Mar 11, 2009
    Messages:
    3,807
    Likes Received:
    2,954
    Occupation:
    Seo and Marketing Suprisingly
    Location:
    Your bedroom window
    Home Page:
    Hmmm pondering about this one
     
  16. OTrap

    OTrap Jr. VIP Jr. VIP

    Joined:
    Jul 12, 2008
    Messages:
    2,286
    Likes Received:
    1,052
  17. GreyWolf

    GreyWolf Executive VIP Jr. VIP

    Joined:
    Aug 17, 2009
    Messages:
    1,930
    Likes Received:
    5,389
    Gender:
    Male
    Occupation:
    Artist / Craftsman
    Location:
    sitting at my PC
    It doesn't look to me as though what your friend is doing is the same as what's discussed on that website.

    Really interesting find though. Thanks.
     
  18. beazt

    beazt Power Member

    Joined:
    Oct 29, 2009
    Messages:
    765
    Likes Received:
    1,245
    Occupation:
    IM
    Location:
    BHW
    Home Page:

    Pardon me for being off-topic, but I wanted to ask Greywolf something regarding this blog:

    Code:
    http://www.wolf-howl.com/
    So Greywolf, is this your blog? Just curious to know since this blog is also from certain "GreyWolf" which happens to be your username. Another similarity is that both this "Greywolf" and you are into SEO. So, is it just a coincidence or r u Micheal Gray?
     
  19. GreyWolf

    GreyWolf Executive VIP Jr. VIP

    Joined:
    Aug 17, 2009
    Messages:
    1,930
    Likes Received:
    5,389
    Gender:
    Male
    Occupation:
    Artist / Craftsman
    Location:
    sitting at my PC
    No Michael Gray is GrayWolf. My username is GreyWolf, which as we all know is the correct form of grey. LOL.

    Actually I hadn't heard of Micheal Gray, or the Wolf Howl blog until long after I'd been using the GreyWolf handle. It's just a coincidence that we both discuss SEO related topics.
     
    • Thanks Thanks x 1