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 question (https://gfy.com/showthread.php?t=910673)

donnie 06-15-2009 08:03 AM

htaccess question
 
I want to allow access to a folder only from links on certain pages. I know how to do this if pages are on the same domain. I have this code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*domain.com/ [NC]
RewriteRule /* http://domain.com/enter.php [L,R]

But what if I want to allow access from several different domains and several different pages? Is that possible with htaccess?

ScriptWorkz 06-15-2009 08:32 AM

I just got up so might be wrong, but i'm pretty sure in this case you can just add more of these lines..

RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*domain.com/ [NC]

one for each domain, and it should work.

Lightning 06-15-2009 08:39 AM

Check this out
http://www.htaccesstools.com/hotlink-protection/

donnie 06-15-2009 09:16 AM

It looks like it is working :) Thank you both!


All times are GMT -7. The time now is 03:56 PM.

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