.htaccess file has a great command over websites. You can perform lots of things without changing the web server’s configuration file.
Earlier I have shown that how to set 404 handler using .htaccess. In this post I am going to cover other errors also with the same trick.
General rule for setting the error handler.
Now let’s see actual code to set the Error Handler file for each of the Server Errors:
Above code will serve given file when the specific error occur. But you can set the HTML that needs to be server on specific error. Let’s see how to set HTML using .htaccess
You have to start html content with double quotation (“), but at the end closing quotation is not required.
Note: You can also set HTML for particular error from .htaccess file.
Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.
View all posts by: Avinash