Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-09-27 13:08:50

Neko
Member
Registered: 2004-03-18
Posts: 458

TXP 4.01 and hotlinking

I’m using a simple htaccess rule to prevent hotlinking of images from my site. But since a few days I noticed this method doesn’t work anymore, while it worked for at least six months without a hitch.

So I was wondering if there are other rules in TXP 4.01 that prevent the hotlinking rules to work properly. I’m asking this because I haven’t touched anything server wise (I’m on TXD) and the only recent modification regarded the upgrade of TXP.

Here’s my method:

<pre>RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?numerozero.com.*$ [NC]
RewriteRule ^.+\.(jpg|jpeg|gif|swf)$ http://www.numerozero.com/i/hotl.png [NC,R,L]</pre>

Thanks in advance for any suggestion.

Offline

#2 2005-09-28 04:50:40

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: TXP 4.01 and hotlinking

The way rewriterules interact varies from server to server. You’ll need to experiment.


Alex

Offline

#3 2005-09-28 12:08:17

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: TXP 4.01 and hotlinking

Thanks zem.

I tried by removing TXP htaccess stuff

<pre>#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule></pre>

and my anti-hotlinking rules worked again. So, that’s TXP. Now I have to figure out how to make the two of them work togheter again.

Offline

#4 2005-10-12 14:32:33

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: TXP 4.01 and hotlinking

BUMP

Anyone? They’re sucking up my monthly bandwidth allowance. x_x

Offline

#5 2005-10-12 14:34:30

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: TXP 4.01 and hotlinking

Add you rules above the Textpattern rules.

Offline

#6 2005-10-12 14:39:01

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: TXP 4.01 and hotlinking

Thanks a lot Sencer, you saved my credit card. :3

Offline

#7 2006-01-09 11:17:46

-P-
Member
From: Finland
Registered: 2005-09-10
Posts: 211

Re: TXP 4.01 and hotlinking

I was able to get this working on 4.0.3. too. One thing though, the “nohotlinking” image doesn´t show. The url for it in .htaccess is correct and image is in the server. I know it is a minor detail but it would be nice to show it.

Offline

Board footer

Powered by FluxBB