Technical guide for Hovixa users on preventing bandwidth theft via Hotlink Protection and mapping custom 404, 500, and 403 error pages in cPanel.

Hotlink Protection and Custom Error Pages Mapping

Efficiently managing how external sites interact with your assets and how your server communicates errors to users is vital for both bandwidth preservation and user experience. This guide covers the implementation of Hotlink Protection and the configuration of custom HTTP error responses.

1. Hotlink Protection (Preventing Bandwidth Theft)

Hotlinking occurs when an external website embeds your images or files (e.g., using an <img> tag) directly from your server. This results in your Hovixa bandwidth being consumed by their traffic. Hotlink Protection blocks these requests by checking the HTTP Referer header.

Configuration Steps:

  1. Log in to cpanel.hovixa.com.
  2. Navigate to the Security section and click Hotlink Protection.
  3. Click Enable.
  4. URLs to allow access: Ensure your own domains (including www and non-www versions) are listed here so your site can still display its own images.
  5. Block direct access for the following extensions: Enter the file types to protect (e.g., jpg,jpeg,gif,png,bmp,webp).
  6. Allow direct requests: Check this if you want users to be able to view an image if they paste the direct URL into their browser address bar.
  7. Redirect the request to the following URL: (Optional) Enter a URL to an "Access Denied" image or your homepage.
  8. Click Submit.

2. Custom Error Pages Mapping

Standard Apache error pages are generic and unhelpful for branding. Custom error pages allow you to provide users with helpful navigation or search options when they encounter a 404 (Not Found) or 500 (Internal Server Error).

Configuration Steps:

  1. Navigate to the Advanced section in cPanel and click Error Pages.
  2. Select the domain you wish to manage.
  3. Click on the specific error code (e.g., 404 (Not Found)).
  4. Enter the HTML code for your custom page. You can use tags like <!--#echo var="REQUEST_URI" --> to show the requested URL.
  5. Click Save.

3. Mapping Existing Files via .htaccess

If you have already designed .html or .php files for your errors, you can map them directly in your .htaccess file. This is often more efficient for complex designs or dynamic error handling.

Example .htaccess Directives:

ErrorDocument 404 /errors/404.php
ErrorDocument 500 /errors/500.html
ErrorDocument 403 /errors/403.html
    

4. Technical Implementation Details

  • Path Accuracy: When mapping via .htaccess, the path should be relative to your public_html (e.g., /404.html).
  • 404 Strategy: For SEO purposes, ensure your custom 404 page still returns a 404 HTTP Status Code. Redirecting a 404 to your homepage (301) is often considered a "Soft 404" by Google and can negatively impact rankings.
  • 500 Errors: If the 500 error is caused by a syntax error in your .htaccess file itself, the custom ErrorDocument directive may fail, and the server will fall back to the default system error page.
¿Le ha resultado útil esta respuesta? 0 Los usuarios encontraron esto útil (0 Votos)