Errorpages

Error Pages Installation

########################################################################
###                      Sparky's ErrorPages V1.0                    ###
###                                                                  ###
########################################################################

Ever wanted to incorporate those 404 error pages into your website to
make them look like they are part of your site.
Now you can with custom error pages that display using your custom whmcs
theme template.
All error pages have been covered from error 100 through to error 510.
Also included is security for your whmcs install with the ability to hide
all of your whmcs files, templates, and directories and show to the user
a 404 not found error.
A fix for the announcements, downloads, and knowledgebase SEO rewites along
with a fix for the base href problem with https on custom pages.


INSTALLATION

STEP 1) Upload errorpage.php to your whmcs root directory.
STEP 2) Upload errorpage.tpl to all of your template directories.
        eg.. default, portal, and your custom theme

STEP 3) Edit your header.tpl
Replace

{if $systemurl}{/if}

With

{php}global $CONFIG;$this->assign('url', (($_SERVER['HTTPS'] == 'on') ? $CONFIG['SystemSSLURL'] : $CONFIG['SystemURL']));{/php}


STEP 4) Upload .htaccess.txt to your WHMCS root directory and rename to .htaccess
STEP 5) Edit the .htaccess file
Find this line
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?YOUR_DOMAIN_NAME.com [NC]

and replace "YOUR_DOMAIN_NAME.com" with your whmcs domain name.

If you have your whmcs in a subdirectory then you will need to insert the subdirectory
name in like this for all the ErrorDocument lines

ErrorDocument 400 /whmcs/errorpage.php
ErrorDocument 401 /whmcs/errorpage.php

All of them will need to be changed.

Thats it!!

To test, browse to any of the whmcs directories or files in those directories
and you should get a 404 file not found error.
If you want to view any of the errors, you can by using errorpage.php?error=XXX
where XXX is the number of the error code.

PLEASE NOTE:
The admin directory cannot be protected in the same way else it will break your backend.
Because of all of the rewrite rules the base href mod is essential.



Note: If you get Internal Server Error then its probably old apache build etc.

You can fix this by :-

In the htaccess file on this line
RewriteRule .* ./errorpage.php [NC,R=404,L]
change it to this
RewriteRule .* ./errorpage.php [NC,F,L]

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Affiliate landing page modification

    WHMCS MOD - Multiple Affiliate Landing Pages MOD Created By D9 Hosting -...

Clientarea POPUP Module

CLIENTAREA POPUPSA popup window will appear on the clientarea home page if the clienthas any...

Credit Invoice Add-On

 Credit Invoice Addon Type: Free Other - Supported Versions: v4.0 and later One...

Spellchecker in admin area

Adding a SpellChecker to WHMCS I figured many people could use this feature as the spell...