Knowledgebase

Static files in Plesk protected directory are inaccessible: ERROR: 404 not found

If static files in a Plesk-protected directory are returning a "404 Not Found" error, it indicates that the web server is unable to locate and serve those files. This issue might be related to the way the protected directory or permissions are configured. Here's a step-by-step guide to troubleshoot and resolve this problem:

  1. Check Directory Structure:

    • Verify that the static files exist in the protected directory and that they are placed in the correct location.
  2. Verify URL Path:

    • Double-check the URL path you are using to access the static files. Ensure it matches the actual path where the files are located.
  3. Review Access Restrictions:

    • In Plesk, go to the domain's settings and navigate to the "Password-Protected Directories" section. Make sure the directory is correctly protected, and the username/password combination is valid.
  4. Check Directory Permissions:

    • Ensure that the file permissions for the static files allow them to be accessed by the web server. Typically, they should have at least read permissions (644 or 755 for directories).
  5. Verify .htaccess Files:

    • If there are .htaccess files in the protected directory or its subdirectories, ensure they don't contain any rules that may interfere with access to static files.
  6. Check for Conflicting Rewrite Rules:

    • In cases where there are custom rewrite rules in the web server configuration or in .htaccess files, make sure they are not causing conflicts that prevent access to static files.
  7. Verify Apache Configuration:

    • Check the Apache configuration files for the domain. Ensure that there are no specific directives that restrict access to static files.
  8. Clear Browser Cache:

    • Sometimes, cached responses from the server or browser can cause issues. Clear your browser's cache and try accessing the static files again.
  9. Check Logs for Details:

    • Review the web server error logs (usually located in /var/log/httpd/ or /var/log/apache2/) for any error messages that might provide more context on why the files are not being found.
  10. Test Direct Access to Files:

    • Try accessing the static files directly by typing the full URL in the browser. This will help determine if the issue is related to the protected directory setup.
  11. Temporary Allow Direct Access:

    • Temporarily remove the protection from the directory and see if you can access the static files directly. This will help narrow down if the issue is related to the protection settings.
  12. Contact Plesk Support:

    • If the issue persists and you're unable to resolve it, consider reaching out to Plesk support for further assistance. They can provide specific guidance based on your setup.

By following these steps, you should be able to identify and resolve the issue preventing access to the static files in the protected directory. Remember to always exercise caution when making changes to server configurations.

  • 0 Users Found This Useful
Was this answer helpful?