Welcome to WebmasterWorld Guest from 54.196.238.210

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

What exactly does this php redirect do?

     

PeaceKeeper

10:07 pm on Apr 19, 2014 (gmt 0)



I was checking my backlinks in ahref.com today and noticed a redirect to my site from a Russian domain.

http://someevilrussiansite.ru/go.php?http://mywebsite.com/wp-content/uploads/2008/05/reallycoolpicture.jpg


Ahref.com says its a 301/302 redirect. What's he trying to do and is it harmful to my website?

Oh I have since changed the image name and put this in my .htaccess not sure if this will stop the redirect from showing up though:



RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mywebsite.com [NC]

RewriteRule \.(jpg|jpeg|png|gif)$ http://some-random-image-22.png [NC,R,L]

penders

11:01 pm on Apr 19, 2014 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Quick guess... looks like they might be hotlinking your reallycoolpicture but avoiding passing any possible "link juice" to your site, by using an intermediary script (go.php).

If you were to (naively) publish your "top referers" then by also appearing as a (popular) referer in your logs then they stand a chance of getting some free linkage back to their site.

It might not be harmful, however, it's not doing you any favours either. They are using your content and bandwidth.

Your RewriteRule (as you have posted) is actually invalid. But it looks like an attempt to redirect any external request for an image (whether it exists or not) to another image. The hotlink/redirect still exists and your bandwidth is still being used.

lucy24

1:04 am on Apr 20, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



I kinda suspect a typo, where you forgot to put /www.example.com/ (your own site) in the target. But don't use a redirect in this situation. Instead rewrite to your no-hotlinks image: leave off the [R] tag.

!^http(s)?://(www\.)?mywebsite.com

I did this for years before figuring out it's wrong. Assuming you have a single preferred form of your domain name, that's the only form that should appear in a hotlinking condition. If your site is http://www.example.com and someone comes in claiming "https://EXAMPLE.COM sent me", they're obviously lying in their teeth and should be blocked. Or rewritten.

PeaceKeeper

8:55 am on Apr 20, 2014 (gmt 0)



Thanks for the replies. So it sounds like there's not much I can really do because the redirect link will still exist. Im not to worried about the resources it's using cause I doubt many people are actually seeing it. I'm just more worried about the SEO implications if there are any. Such as does Google think this Russian domain is my site and I'm trying to pass link juice onto this other site by doing this redirect.

penders

9:51 am on Apr 20, 2014 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



It's them who are issuing the redirect - so there's not much you can do about that (except from blocking or interfering with the request at your end, which is what your .htaccess script is doing.)

If this is just a one-off, low traffic "link" then it's unlikely to have any negative SEO consequences - even if the site is unsavoury. But if it's not passing "link juice" ie. "go.php" is blocked from crawlers, then it shouldn't even be seen by Google. Does this appear in Google's backlink report as well? Does ahref.com (do you mean ahrefs.com?) honour robots.txt?

If you do find you have harmful links to your site that are out of your control then Google has a "Disavow Links Tool" that permits you to discount these backlinks from its ranking algorithm.

Have you tried tracing this link back to its source to see the context in which it is used?

jay5r

11:04 pm on Apr 21, 2014 (gmt 0)

5+ Year Member



For starters it's not a PHP redirect - it's an Apache mod_rewrite rule.

The biggest problem is that last line is broken - it will redirect to a bad URL. But if that were fixed, what the rule is supposed to be doing is serving one particular image for all images in the directory when it detects a hotlink (as defined by a referrer that's not from your site).

penders

11:42 pm on Apr 21, 2014 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



For starters it's not a PHP redirect - it's an Apache mod_rewrite rule.


@jay5r: I think you might have skipped the first half of the question?

lucy24

1:25 am on Apr 22, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



We're in the php forum. It may have been a mistake on the OP's part; Apache and PHP are side by side in the subforums list.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month