GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   htaccess in a folder (https://gfy.com/showthread.php?t=431645)

nico-t 02-14-2005 09:44 AM

htaccess in a folder
 
i got the root htaccess file blocking hotlinking now.
Now i want 1 folder on my site to not have this. BUT, that folder does have to block fusker shit and stuff.
My htaccess code in the root is ok now, so i thought i could get another htaccess file in the folder like this one:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^.*fusker*.*$ [NC]
RewriteCond %{HTTP_REFERER} ^.*usefulidiot*.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ des/test/hotlinkimg-d.gif [L]

But that doesnt work... Please someone give me a link about this or explain how i can do this, i searched google and i been searching for this whole afternoon and still found nothing i can use.

swedguy 02-14-2005 09:59 AM

http://www.htaccesstools.com/

nico-t 02-14-2005 10:58 AM

Quote:

Originally Posted by swedguy

thanks but that aint got the issue i got: setup specific htaccess options for a folder of my website.

directfiesta 02-14-2005 11:08 AM

Aren't all subfolders subject to the " top " htaccess file ???

So you couldn;t be LESS restrictive, but MORE restrictive in subfolders....

????

jonesy 02-14-2005 11:12 AM

take the htaccess out of your root - drop it in the folder/s you want to protect

then drop the other htaccess file with the fusker url and drop that into the other folder you want to protect from fusker

nico-t 02-14-2005 11:17 AM

aha ! well i knew there was something about subfolders etc., i read it somewhere but didnt knew the site anymore... so thanks for the tips, im gonna try it right now.

nico-t 02-14-2005 11:22 AM

fuck this is a lil more complicated then i thought... i have to think backwards and shit.. damn... testing some shit out now tho...

Project-Shadow 02-14-2005 11:26 AM

Place a blank .htaccess file in the folder you want no restrictions on.

swedguy 02-14-2005 11:31 AM

Should work...

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^.*fusker.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^.*usefulidiot.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ /test/hotlinkimg-d.gif [L]

There should be an OR in all the RewriteCond's except that last one.

nico-t 02-14-2005 11:50 AM

Quote:

Originally Posted by swedguy
Should work...

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^.*fusker.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^.*usefulidiot.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ /test/hotlinkimg-d.gif [L]

There should be an OR in all the RewriteCond's except that last one.

this kinda misses the point im making i think? This has nothing to do with working with folders, this is just the code itself...
And the code itself is working, the OR in it doesnt matter... thanks ne way for you input hehe...

anyway, I think its working properly now... let me give u my site structure to show what ive done and what id like:

LEVEL 1 - ROOT FOLDER
htaccess file with only 404 and 403 redirection in it

LEVEL 2 - FOLDER 1, FOLDER 2, FOLDER 3
folder 1: htaccess with anti hotlinking from all sites
folder 2: htaccess with anti hotlinking from all sites
folder 3: htaccess without anti hotlinking, except fusker and usefulidiot

^^^ this seems to work, but that are alot htaccess files...


A question to Project-Shadow: so when i put the anti hotlink in the root again, and just a blank htaccess in 'folder 3', it accepts hotlinking from files in folder 3? But what if i only wanna block fusker in folder 3? Is there another way to do that then what i just did?

swedguy 02-14-2005 12:00 PM

Quote:

Originally Posted by nico-t
this kinda misses the point im making i think? This has nothing to do with working with folders, this is just the code itself...

You stick it IN the folder you are talking about (folder 3 according to your example)

Quote:

And the code itself is working, the OR in it doesnt matter... thanks ne way for you input hehe...
The OR matters a lot.

collegegirlvids 02-14-2005 12:04 PM

I just use proxypass... they take care of everything and you don't have to do anything at all for $50 =)

swedguy 02-14-2005 12:10 PM

Lets make a test. I have a folder open for all hotlinking, except from gfy.com.

You should see a pair of boobies below if you look at this thread from gofuckyourself.com
http://nuvisiongroup.com/hotlink/boobies.gif

If you look at the same thread from gfy.com, you should see a pink Elephant

fucking-around-and-business-discussion/431645-htaccess-folder.html


EDIT: Remember to clear your cache, otherwise you will still see the boobs.

nico-t 02-14-2005 12:35 PM

Quote:

Originally Posted by swedguy
You stick it IN the folder you are talking about (folder 3 according to your example)


The OR matters a lot.

yes, im sorry i been working on this for the past 5 hours and im getting a lil slow and very irritated...

The good news from my other post that it works now is bullshit, i did a lil testing and its still fucked up.

I did see your test, with the boobies and the pink elephant. Im gonna change my file and test it later on, im gonna take a break now im kinda fed up with this shit...
thanks for your reply

swedguy 02-14-2005 12:48 PM

If it wasn't clear before, you will only get the pink elephant when the hotlink protection kicks in (for example from the fusker sites) :)

I used the same htaccess as I posted above.


What the OR does is exactly like in the English language.

If site is "fusker" OR "usefulidiot" OR "hotlinker2" OR "hotlinker3", redirect them to /test/hotlinkimg-d.gif

nico-t 02-14-2005 03:26 PM

holy shit i think its working now...
what i did:


I put this htaccess file in the root directory:
Code:

ErrorDocument 404 http://www.mydomain.com/404.html
ErrorDocument 403 http://www.mydomain.com/404.html

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^.*msn\. [NC]
RewriteCond %{HTTP_REFERER} !^.*yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !^.*altavista\. [NC]
RewriteCond %{HTTP_REFERER} !^.*google\. [NC]
RewriteCond %{HTTP_REFERER} !^.*webcrawler\. [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ des/test/hotlinkimg-d.gif [L]

And i put this htaccess file in the folder where sites can hotlink from, except for 'fusker' etc:
Code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^.*fusker*.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^.*usefulidiot*.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ test/hotlinkimg-d.gif [L]

thanks swedguy for explaining :thumbsup

swedguy 02-14-2005 03:29 PM

np :thumbsup


All times are GMT -7. The time now is 07:00 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123