Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,048
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Access Denied Error

    How can I create a "403 Access Denied Error"?

    I need to do this to make sure that my custom 403 page is actually working!

    Thanks,


    Debbie

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,903
    Thanks
    15
    Thanked 226 Times in 226 Posts
    By setting permissions so strict that the file can only be opened by root. You may have to use an ftp client to do this, or you may be able to do it with php. Use chmod, e.g. chmod("./file",0444);
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #3
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,048
    Thanks
    25
    Thanked 0 Times in 0 Posts
    Or by placing a .htaccess file in a directory with this code...
    Code:
    deny from all
    ...and then trying to access said directory!

    Sincerely,


    Debbie

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,903
    Thanks
    15
    Thanked 226 Times in 226 Posts
    Quote Originally Posted by doubledee View Post
    Or by placing a .htaccess file in a directory with this code...
    Code:
    deny from all
    ...and then trying to access said directory!

    Sincerely,


    Debbie
    But restart your server for that method.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #5
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,292
    Thanks
    4
    Thanked 202 Times in 199 Posts
    Quote Originally Posted by DrDOS View Post
    But restart your server for that method.
    No need to restart the server when a .htaccess file is modified. It is processed every time the directory is looked at by Apache.
    Dave .... HostMonster for all of your hosting needs

  • #6
    New Coder
    Join Date
    Nov 2011
    Location
    Ratio, Logic
    Posts
    59
    Thanks
    3
    Thanked 6 Times in 6 Posts
    I am thinking this could be the wanted answer:
    Code:
    ErrorDocument 404 /my-error-pages/my404notFoundPage.php
    #or
    ErrorDocument 403 http://someotherdomain.com/blacklist/badip-logger.php


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •