homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Redirecting a cloaker?
How do I stop someone from cloaking me

Msg#: 4614695 posted 6:00 pm on Oct 4, 2013 (gmt 0)

I have found a site that is cloaking one of my sites.

If you got to [theirsite.com...] you see [mysite.com...]

This is not a redirect, the content that is shown is 100% from my site, not a copy of mysite.

This is all I could find...

RewriteEngine on
Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} ww\.theirsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} theirsite\.com [NC]
#RewriteRule .* - [F]

All this does is block my css and images from appearing on their site, but the text is still showing.

Ideally I would like to redirect this dude to googlehammer.com or some other nasty place, but for sure I would like to at least stop his ip/url from showing my content.

Any help?



Msg#: 4614695 posted 6:36 pm on Oct 4, 2013 (gmt 0)

Just to note, my site has around 2,000 pages and every page/url of the site is cloaked so that they all show up on his url.

I can change the content on mysite.com and it changes on hissite.com He is mirroring my url to his url


WebmasterWorld Administrator 5+ Year Member Top Contributors Of The Month

Msg#: 4614695 posted 7:22 pm on Oct 4, 2013 (gmt 0)

Are they hosted on the same host? From what you have described, it seems that the host name points to the same webspace on your server.

Are you on shared hosting?

Have you looked at HTTP response codes you get when you go to their site?


Msg#: 4614695 posted 7:43 pm on Oct 4, 2013 (gmt 0)

No, completely different hosts, different countries, this is cloaking 101.

I know how to set up cloaking, but dont know how to stop it


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

Msg#: 4614695 posted 9:02 pm on Oct 4, 2013 (gmt 0)

RewriteCond %{HTTP_REFERER} ww\.theirsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} theirsite\.com [NC]
#RewriteRule .* - [F]

You don't want referer. You want hostname. And if you cribbed this code from someone else, never use their code again; it uses two lines to say what could be said in one. In fact the first Condition as written is completely redundant, since it's a subset of the second.

But don't you already have a domain-name-canonicalization redirect? The one that looks like this:

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

If you are content to just forcibly redirect requests from their site-- which is a pretty big neener-neener on its own-- that's all you need to do. If you want to disown any and all connection with the site, go to

RewriteCond %{HTTP_HOST} example\.biz
RewriteRule .? - [F]

Put this at the front of your RewriteRules, with any other [F] rules. Here example.biz is the offending site. Unlike your domain-name redirect, this version uses no anchors, because you want to be sure to grab everyone.

If it makes you happy you can replace the [F] part with a redirect to Keep it with the [F] rules, because this redirect is functioning as a denial. Never redirect to an existing third-party site. This applies even to robots who don't follow redirects; here it's doubly Not Nice because we're talking about unsuspecting humans.

A final option is to redirect back to the offending site. But this will place a bit of a load on your server, since browsers make anywhere from 10 to 30 requests before throwing in the towel. (It's the equivalent of screaming Wrong number! thirty consecutive times into the telephone-- while telling them to call the same number again.)


Msg#: 4614695 posted 9:22 pm on Oct 4, 2013 (gmt 0)


You don't have permission to access / on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Thank you very much... works perfect!


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

Msg#: 4614695 posted 12:53 am on Oct 5, 2013 (gmt 0)

Uhm... That was satire, wasn't it? ;)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved