6 Years
Discussion Span
Last Post by disposable_zero

1. Open Notepad.
2. Save as a regular text file (for example: file.txt).
3. Upload the file to your server and rename it to .htaccess (not file.htaccess, simply .htaccess.
4. Open the .htaccess file.
5. Write these two lines into your document:
ErrorDocument 404 http://your-site.com/error.html
ErrorDocument 403 http://your-site.com/error.html
6. Create a new html document and save it as error.html.
7. Upload it to your server - that's it!


OK, it's actually simple.
create a file called

In it type:

<File .htaccess>
order allow,deny
deny from all 
ErrorDocument 404 http://yourdomainname.com/error.html
ErrorDocument 403 http://yourdomainname.com/error.html

The first bit inside the File tag says that no one can view that file. The last part says to redirect to those to website incase of a 404 or 403 error. replace yourdomainname.com with the name of your domain. Now, create a file called error.html that will be your error page
Now upload to your server, and you are good to go!


Thanks for all the solutions, got it now. Had no idea it was that easy! Guess you learn something every day ;)


Hate to double post but it won't let me edit. Just wanted to mention that if you're coding this Romil wrote it:

order allow,deny

That actually locks out your whole site, had a mild heart attack for a second. It should be written:

order deny,allow

Other than that mistype it now appears to be working great. Thanks again!

This question has already been answered. 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.