Welcome to WebmasterWorld Guest from 54.196.114.201

Forum Moderators: open

Message Too Old, No Replies

practical .htaccess cloaking

...or, a way to cloak without a secondary interpreter

     
9:27 am on Jul 4, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member littleman is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:June 17, 2000
posts:2924
votes: 0


Some time ago I played around with .htaccess cloaking, there are probably lots of ways to do this but I think it could actually be a simple process where you create parallel architecture in sub-folders and point the bots to them. Here is an example"

You need need to give a custom 404 so that apache doesn't give away your modified request_uri if the file could not be found.

You could do either IP or UA or cloaking or both via .htaccess. You could do full IP matches, or partial, and you could match case insensitive UA strings.


ErrorDocument 404 notfound.htm
RewriteEngine on
RewriteBase /
##Stinky PFI Bot
RewriteCond %{REMOTE_ADDR} ^111.222.331回111.222.332回111.222.333回111.222.334 [OR]
RewriteCond %{HTTP_USER_AGENT} ^Stinkybot回Slurpy_PFI [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Mozilla/5.0 Stinky/1.2.5 (X11; Linux i686; U;) PFI/CAT"
RewriteCond %{REQUEST_URI} !stinky/
RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^(.*)$ /stinky/$1 [L]
##Goggly Bot
RewriteCond %{REMOTE_ADDR} ^112.222.341回112.222.342回112.222.343回112.222.344 [OR]
RewriteCond %{HTTP_USER_AGENT} ^Gogglybot回Pinky_and_the_BRAIN [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Mozilla/5.0 Gogglybot/CIA EAT YOU HART OUT"
RewriteCond %{REQUEST_URI} !goggly/
RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^(.*)$ /goggly/$1 [L]

In this example all requests from Stinkybot will be internally routed to the subfolder stinky/.
So if Stinkybot asks for www.domain.com it will serve up www.domain.com/stinky/index.html.
And Gogglybot will get www.domain.com/goggly/index.html for the same request.

While it isn't as robust as a cloaking method that takes advantage of secondary scripting it could be practical for mom and pop cloaking.

Air

3:44 pm on July 4, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 10, 2000
posts:1253
votes: 0


I've played around with that set up too little, it's good but the problem is that it requires you to know what you're doing, and as you said it can be somewhat limiting compared to scripting/programming. It creates an interesting paradox, if you know what you are doing you're likely to script something, if you don't know or feel un-comfortable working with .htaccess then you're likely a good candidate to be satisfied with the limited "features" that method provides.
3:52 pm on July 4, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 10, 2001
posts:1551
votes: 10


RewriteCond %{REMOTE_ADDR} ^111.222.331?^111.222.332?^111.222.333?^111.222.334 [OR]

You might want to consider this simpler phrasing:

RewriteCond %{REMOTE_ADDR} ^111.222.33[1-4] [OR]

The only "issue" with your approach is that any SSI virtual directives in your HTML will still reference the original document root. That may or may not be a problem, given your specific setup.

5:55 pm on July 4, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member littleman is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:June 17, 2000
posts:2924
votes: 0


Bird -
You might want to consider this simpler phrasing:

RewriteCond %{REMOTE_ADDR} ^111.222.33[1-4] [OR]

Hehe, I was bing lazy about modifying a working model. That was a cut and paste job from a real example, but I had to take out the real IPs and put in the filler. RewriteCond %{REMOTE_ADDR} ^111.222.33[1-4] [OR] is a lot cleaner.

Air-
Well I guess it works for old spammers like me. I've found it practical for sites when I just want to pump up the KW% and link architecture slightly on smaller Ecommerce sites. When $pop =~ m/old spammer/i; it works. ;)

Air

2:19 am on July 5, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 10, 2000
posts:1253
votes: 0


>Well I guess it works for old spammers like me.

Little, I hate to admit it, but it even works for spammers older than you ;)