0

Hello,

Is there a way to set up of custom html pages to replace the default pages that error throw?

I use htaccess to deny some IPs from members via FireWall. Every time these members access my site, they will receive an error.

However, I want to set up a custome page to replace the default pages that error throw.

How do I set such a default page for that error?

Thanks.

HAPPY NEW YEAR!

2
Contributors
1
Reply
5
Views
5 Years
Discussion Span
Last Post by LastMitch
0

Is there a way to set up of custom html pages to replace the default pages that error throw?

You mean these errors:

400 - Bad request
401 - Authorization Required
403 - Forbidden
404 - Wrong page
500 - Internal Server Error

If you don't know how to create a error pages you can read this:

http://www.hongkiat.com/blog/60-really-cool-and-creative-error-404-pages/

It will give you an idea on how to create one.

on the .htaccess file you need to add this (just an example):

DirectoryIndex index.php
ErrorDocument 400  /400.php 
ErrorDocument 401  /401.php 
ErrorDocument 403  /403.php 
ErrorDocument 404  /404.php 
ErrorDocument 500  /500.php 

Regarding about blocking (Deny) and allowing (Allow) it should look like this on your htaccess file (just an example):

#Deny List
order allow,deny
deny from 125.126.127.128 #specify a specific address
deny from 125.126.127.128/29 #specify a subnet range
deny from 125.126.* #specify an IP address wildcard
allow from all

#Allow List
order allow,deny
allow from 145.146.147.148 #specify a specific address
allow from 145.146.147.148/40 #specify a subnet range
allow from 145.146.* #specify an IP address wildcard
deny from all

Edited by LastMitch: grammer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.