WordPress.org

Ready to get started?Download WordPress

Forums

How to create a custom 403-forbidden? (4 posts)

  1. Shurikn888
    Member
    Posted 6 years ago #

    Hi, I tryed to create a 403-forbidden-php-file and it was failed.

    I just copyed the 404.php, changed the message and renamed to 403.php. Then I add "ErrorDocument 403 index.php?error=403" to my .htaccess file.

    But it still shows the usual Forbidden-Site and added following message:

    "Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request."

    Can somebody explain it me how to fix it?

    Thank you very much

  2. VincentvandenHeuvel
    Member
    Posted 6 years ago #

    Hi, in your .htaccess file you can define the custom error pages. These can be already set up by you hosting company/provider (for example 403.shtml). By using the .htaccess file you'll override the default settings and this makes it possible to create your own custom designed error pages. The example below show error files in the root of your website directory.

    # BEGIN Error Documents
    ErrorDocument 400 /400.php
    ErrorDocument 401 /401.php
    ErrorDocument 403 /403.php
    ErrorDocument 404 /404.php
    ErrorDocument 500 /500.php
    # End Error Documents

  3. itissue
    Member
    Posted 6 years ago #

    Wouldn't they show the error document's url if you use this method though? How can you make it so the url stays the same as whatever someone entered?

  4. itissue
    Member
    Posted 6 years ago #

    Nevermind. I figured it out. They only show the full path if you start with http://.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags