Giter VIP home page Giter VIP logo

wordpress-custom-error-pages's Introduction

Custom Error Pages

Create custom 401 and 403 error pages with any WordPress theme without writing a single line of code, set it up and forget it.

Description

WordPress offers inbuilt support for custom 404 pages on all themes. But what about custom pages for other common errors like 401 and 403? You end up seeing a bland error page of the Web Server.

With this plugin you can easily create custom 401 and 403 error pages with any theme without writing a single line of code!!! And the best part is that you set it and forget it. Yes, you don't have to do any changes even if you change themes. The heading and text you want on 401 and 403 error pages are displayed on the currently active theme.

Further Reading

Installation

  1. Install and activate the custom error pages plugin.
  2. From the wp-admin go to Settings > Custom Error Pages, fill in the heading and content boxes, save the changes and preview it.
  3. Configure your web server to use a custom error page.

Apache users edit your .htaccess file and add the following lines.

ErrorDocument 403 /index.php?status=403
ErrorDocument 401 /index.php?status=401

Nginx users edit your nginx.conf file and add the following lines.

error_page	403 = /index.php?status=403
error_page	401 = /index.php?status=401

Try accessing a file or directory which is forbidden like

http://www.example.com/.htaccess

http://www.example.com/wp-includes/

Did you see a custom 403 page in all the glory of your theme?

Frequently Asked Questions

Should I do anything if I change themes?

No not at all. You just install the plugin set it and forget it. The plugin isn't theme bound so it'll work even after switching themes.

I noticed define( 'DONOTCACHEPAGE', TRUE ); in the plugin code what is it for?

This tells caching plugins like W3 Total Cache and WP Super Cache not to cache the 401 and 403 error pages. This does NOT affect the cacheability any other pages of your site.

Does this plugin automatically edit the .htaccess or nginx.conf file?

No it doesn't. You have to manually edit it and add the necessary configuration specified in the plugin's option page.

Credits

This plugin was written by @jesinwp.

Version 1.2 in that repository was made by @sizious, so it's unofficial.

wordpress-custom-error-pages's People

Contributors

sizious avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.