Hotlinking Protection & Other Rewrite Rules Won't Work Together

vinyl-junkie

Registered
Sep 19, 2004
4
0
151
I have a hand-coded .htaccess file with both hotlinking protection code in it and some other rewrite rules. When I uploaded it to my web server, I noticed that the hotlinking protection wouldn't work, although cpanel said hotlinking protection was enabled. Here's a portion of my .htaccess file:
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?napathon.net(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.napathon.net/images/nohotlink.gif [R,NC]
RewriteRule ^AlbumID([0-9]+)\.html /TrackListRedirect.php?AlbumID=$1 [L]
When I went into the control panel and clicked on Disable Hotlinking, here's what cpanel did to my .htaccess file:
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?napathon.net(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.napathon.net/images/nohotlink.gif [R,NC]http://www.napathon.net/TrackListRedirect.php?AlbumID=$1
Seems as though cpanel has a bug. Is there something that can be done about this? I'd appreciate some comments from cpanel staff about this issue. Thanks.
 

Pixx

Registered
Oct 14, 2005
1
0
151
Yes, I've had something similar happen.

In my case, the .htaccess file already had some rewrite conditions and rules in it to produce search engine friendly URL's on products in a shop, but no hot-link protection code.

I accidentally clicked on the 'disable' button in CPanel -> Hot Link Protection and CPanel removed *all* my custom rewrite conditions and rules in the .htaccess, even though hot-link protection hadn't been enabled in CPanel.

Need to be careful with the hot-link protection option until CPanel gets this sorted out ... ;-)
 

vinyl-junkie

Registered
Sep 19, 2004
4
0
151
Thank you! At least I can now confirm that I wasn't crazy when I experienced this problem. ;) FWIW, I had my ISP turn off cPanel's hotlinking protection so that option doesn't even show up on cPanel for me. That seems to have solved the problem. However, it would be much preferred if cPanel would play nicely with the code in .htaccess that I build myself.

I have a question related to this problem, and I really hope that cPanel staff pay attention to what goes on in the forum. When this problem occurred for me way back when, I seem to recall that proper protocol was to work through my ISP to get the bug reported and tracked through Bugzilla.That appears to still be the case even now. Well, my ISP at the time was a reseller so he had to work through his ISP to get the problem reported and tracked, and as far as I have ever been able to determine, no one did a damn thing to get this one under the noses of cPanel staff.

If cPanel staff would allow me to do so, I can write a bug on this, complete with steps to reproduce and the whole bit. I daresay that I'd write a better problem statement than the vast majority of bugs that I've looked at out there. :p

What do you say, cPanel? Will you write a bug on this, or will you give me security to write one? This really needs to get solved.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
31
473
Go on, have a guess
If you want to report a bug you need to follow the procedure from their site. A reproducable bug should be reported in bugzilla and/or a support ticket raised with them through your cPanel license provider.
 

jackie46

BANNED
Jul 25, 2005
536
0
166
This problem is 3yrs old and has never ever worked properly. I guess its not their priority to fix it and im sure there are multiple bugs been submitted on this already.
 

vinyl-junkie

Registered
Sep 19, 2004
4
0
151
chirpy said:
If you want to report a bug you need to follow the procedure from their site. A reproducable bug should be reported in bugzilla and/or a support ticket raised with them through your cPanel license provider.
All that sounds very nice, except that my cPanel license provider didn't follow through with submitting a bug when I reported the problem, and since I don't have a cPanel license myself, I guess I'm screwed since I'm not allowed to write a bug. Bottom line: Unless someone who is authorized to write a bug does it, this one will remain in the same state it's been since I discovered it - swept under the rug.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
31
473
Go on, have a guess
Then your cPanel license provider is breaking their agreement with cPanel as it is their duty to do so.

That aside, anyone can create an entry in bugzilla if they wish to.