# Show RapidLeech's own 404 page for missing URLs.
# If RapidLeech is installed in a sub-folder, change this to /that-folder/404.php
ErrorDocument 404 /404.php
# Private folders (configs, classes, hosts...) show the same styled page as "403 Forbidden"
ErrorDocument 403 /404.php

# Prevent directory listing
Options -Indexes

# The script's own folders are private. "deny from all" in their .htaccess files works on Apache but
# OpenLiteSpeed ignores it, so a rewrite rule (which both follow) sends them to the error page instead.
# Only classes/js.js is loaded by the pages, so .js files in classes/ stay open.
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteRule ^classes/[^/]+\.js$ - [L]
	RewriteRule ^(configs|classes|hosts|languages|rar)(/|$) 404.php?private=1 [L,QSA]
	RewriteRule ^templates/.+\.(php|phtml|inc)$ 404.php?private=1 [L,QSA,NC]
</IfModule>
