The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hot linking problem

Discussion in 'Security' started by vividwebdesigns, Mar 3, 2013.

  1. vividwebdesigns

    Joined:
    Mar 3, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I tried to enable hot linking but I got an error " There was an error while enabling hotlink protection. Show Details " the error is" Apache detected an error in the Rewrite config. Syntax error on line 503 of /home/hardware/public_html/.htaccess.NJVd1ZnSL5I7F960l8IIFZ_kgMpgWhWs: RewriteRule: bad flag delimiters Please try again. " But even with the error all my picture on all my websites vanished and a x has replaced the picture What I did next is changed the name of the .htaccess file and when I did that a new .htaccess file was made which fixed the error. I still have no pictures on my sites. I have had friends look at my site and they see what I see, no pictures. When a new .htaccess file was made all my sites appeared in the URLs to allow access: window. I have deleted the sites but they keep coming back in the window.
     
    #1 vividwebdesigns, Mar 3, 2013
    Last edited by a moderator: Mar 4, 2013
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Your images appear to be or have been located in the public_html directory. Any image you see on your site with a red x, right click it and choose properties, or View image Info, to find it's location path. Once you know the path you can check there to see if the image exists.

    Rename your .htaccess to htaccess.txt and then check to see if your images work.
     
  3. vividwebdesigns

    Joined:
    Mar 3, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks Infopro for your reply. I made a mistake the pictures have a broken picture symbol not an x. The pictures were all working until I tried to enable hotlink protection very strange. The .htaccess is a txt already thanks again for your help any other ideas please let me know.
     
    #3 vividwebdesigns, Mar 4, 2013
    Last edited: Mar 4, 2013
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Your reply doesn't let us know if the problem continues or not.
     
  5. vividwebdesigns

    Joined:
    Mar 3, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Sorry the problem isn't fixed I still have no pictures.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you tried my suggestions.
     
  7. vividwebdesigns

    Joined:
    Mar 3, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Yes I did it did not work when I renamed the file in the pubic_html. My hosting provider is now helping me with this problem and have had some success when the hotlinking is disabled but not when it's enabled. To get it to work when disabled the file .htaccess in the root of mypuppy and vividwebdesigns was renamed .htaccess_bak. So I guess Infopro if I had of renamed the file to htaccess.txt in the root of mypuppy and not in pubic_html your solution might of worked. I will post how they fixed the pictures disappearing when Hotlink protection is enabled.
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Well, the root of mypuppy is the public_html of mypuppy. The root of vivid is the public_html of vivid. If these are both addon domains, they have their own public_html directories. If these 2 are parked domains, onto a 3rd domain, all 3 only have one public_html directory.

    Renaming the .htacess to anything else, htaccessVIVID for example, disables it effectively, as the server is looking for the specific file name: .htaccess

    When the server finds that file, named correctly, it reads it for instructions. Instructions like hotlink prevention instructions. Renaming that files kills any hotlinking you have enabled. If you try to enable hotlinking protection again, after renaming that .htaccess file, cPanel will create a brand new, .htaccess file and add new hotlinking protection instructions to it.

    I'm only highlighting this for you to assist in understanding this more clearly. :)


    GL!
     
  9. vividwebdesigns

    Joined:
    Mar 3, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Yes root was not correct term. However when the .htaccess was renamed in the folder where mypuppy and vividwebdesigns are the pictures showed up. So it worked to display the pictures that is all I care about at the moment. There must be a major problem with my Hotlink protection.
     
  10. vividwebdesigns

    Joined:
    Mar 3, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    This is what I had to do to get my hot link protection to work.

    Please follow the steps given below to enable/disable hot link protection:


    1. Login to cPanel and click HotLink Protection.
    2. Make sure the domain name you wish to protect is in the box called "URLs to allow access".
    3. In the box called "Block direct access for these extensions", provide the extensions for which you would like to block e.g jpg,jpeg,gif,png,bmp.
    4. Check the box for "Allow direct requests".
    5. Skip the "Redirect request to this URL" box (you can add a URL if you want)
    6. hit Submit.

    I have watched a lot of videos and read a lot of articles and none of them said to do what number four says Check the box for "Allow direct requests". My hosting company said to do this.

    I hope this helps someone else to get there site up and running quicker.
     

Share This Page