Just saw this in someone's .htaccess file

OTrap

Elite Member
Joined
Jul 12, 2008
Messages
2,314
Reaction score
1,064
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?
 
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.
 
That's weird. HIS site is still up. I'm in his cPanel (with permission).
 
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?
 
Looks like he's redirecting his site to go to an affiliate site. That's what a 301 redirect is.
 
But when you go to his URL, it shows up like it always has.
 
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.
 
Weird, though, because it doesn't redirect. If you go to his domain, it stays at his index.html page.
 
Weird, though, because it doesn't redirect. If you go to his domain, it stays at his index.html page.

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~
 
kunalagg, I'm a friend of his. It was with his permissions.
 
But when you go to his URL, it shows up like it always has.
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.

And It Randomly Redirects to Link1 link2 and Link3 Instead of redirecting only to a single page!!
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.
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.

I'm a friend of his. It was with his permissions.
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:
 
Maybe tomorrow. He's not in a proper frame of mind to discuss business this evening, if you catch my drift.
 
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.


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?
 
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?
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.
 
Back
Top