Results 1 to 7 of 7

Thread: Hotlinking Protection & Other Rewrite Rules Won't Work Together

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    4

    Default Hotlinking Protection & Other Rewrite Rules Won't Work Together

    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.

  2. #2
    Registered User
    Join Date
    Oct 2005
    Posts
    1

    Default

    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 ... ;-)

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    4

    Default

    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.

    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.

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    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.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    BANNED
    Join Date
    Jul 2005
    Posts
    537

    Default

    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.

  6. #6
    Registered User
    Join Date
    Sep 2004
    Posts
    4

    Default

    Quote Originally Posted by chirpy
    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.

  7. #7
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    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.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads

  1. Rewrite Rules for all sites
    By jimhermann in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 06-28-2011, 11:38 PM
  2. Hotlinking Protection
    By ChrisFirth in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 09-10-2009, 10:12 PM
  3. Hotlinking Protection
    By Norco in forum Security
    Replies: 0
    Last Post: 06-23-2007, 10:58 PM
  4. PHPsuexec and Rewrite Rules
    By zigzam in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 06-08-2006, 11:27 AM
  5. What is Hotlinking Protection
    By ene in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 12-31-2003, 01:21 PM