Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Password Protecting public_html and Magento issues

Discussion in 'General Discussion' started by basslion, Mar 30, 2017.

  1. basslion

    basslion Registered

    Joined:
    Jul 8, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Markham
    cPanel Access Level:
    Website Owner
    When we password out root public_html directory and then go to our website admin panel which requires login (Magento), the site fails to load css, images and javascript. On the login page if we view source, we see the paths to all the css, images and javascript and if we click these links, we get error 404 not found when in fact the file is there on the ftp.

    When we remove password protect, the site functions normally with no issues and all css, images and javascript paths are functional.

    I am thinking this is a server related issue. does anyone know what could be causing this?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,769
    Likes Received:
    313
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Password protecting public_html sets it for the entire domain.com
     
  3. basslion

    basslion Registered

    Joined:
    Jul 8, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Markham
    cPanel Access Level:
    Website Owner
    Ok i know this, but how does that explain why css, images and javascript are not being found when called upon?
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    This usually happens when something is wrong with the path to your htpasswd file

    Can you ensure the path is correct? Also try adding this to the end of the htaccess rules:

    ErrorDocument 403 default

    Example:

    Code:
    AuthType Basic
    AuthName "Secure Area"
    AuthUserFile "/home/user/.htpasswds/public_html/passwd"
    require valid-user
    ErrorDocument 403 default
     
Loading...

Share This Page