Error Pages

19.Nov.2011  |  Posted by admin  |  Filed under Tutorials

Havalite version 1.0.8

Up to this version Havalite can handle error pages which are assigned from server as 403 (forbidden) or 404 (Not found). There are surely much more HTTP error codes than these two (see here) but we left this part up to you which code need to be handled.

To customize your HTTP error codes, create a file, copy following code and save as .htacccess to the root directory:

ErrorDocument 404 /havalite/hava_error.php

To add more codes, copy and past the line and change the number to your requested error code. Example:

ErrorDocument 401 /havalite/hava_error.php

If you didn't install havalite in the root directory, you need to define the right path to hava_error.php in your .htaccess file by adding the directory name in which havalite is installed. Example

ErrorDocument 404 /(directory name)/havalite/hava_error.php

Design your Error page

The default error page text is "PAGE NOT FOUND!". To change this error text go to admin area of Havalite, Click on the menu "Settings" and choose "Design". In the textarea you can add your own text or HTML.

You can also handle any error from within your theme by redirecting to havalite/hava_error.php or ?p=error or by calling  the hava_option('error_page'); function. Here's an example for requesting a post which is not integer:

if ( !is_numeric($p) ) {
   echo hava_options('error_page');


Hint: some servers do not allow users to upload there own .htaccess files with the ErrorDocument command per ftp. But instead you can do that directly in your service center by looking for the error_files section. In the form input for 404 errors add the line /havalite/hava_error.php

Related Postsdefault ErrorDocument error 404 403 401 apache configuration server


Write a Comment



We are a team, that resides in Germany (please, do forgive our bad English) and we have developed an international based and uncomplicated software for users, who do not know (or do not like to know) much about all this programs like HTML, PHP, SqLite, JS, Browser differences etc.. Users who like  to ....Read More
Havalite CMS in english language Havalite CMS in deutscher Sprache هافالايت العربية لنشر المقالات