To prevent direct access to .tpl
files in your WHMCS installation, you can add a rule to your .htaccess
file. This will block anyone from accessing your .tpl
template files directly through the browser.
Follow these steps:
-
Open your
.htaccess
file located in your WHMCS root directory. -
Add the following code:
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
- Save and close the file.
This rule will restrict access to any .tpl
files, ensuring that users cannot directly view or download them through a web browser.
Important Notes:
- Make sure to backup your
.htaccess
file before making any changes. - Ensure your server allows
.htaccess
overrides. If it doesn't, you may need to contact your hosting provider for assistance. - This method does not prevent access to
.tpl
files via PHP or other server-side scripts. It only restricts direct access through the browser.
-
Set the article to be visible and assign it to an appropriate category.
-
Save the article.