Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Need to respond with a 403 status code?

by grep (Monsignor)
on Apr 19, 2007 at 16:26 UTC ( #610983=note: print w/ replies, xml ) Need Help??


in reply to Need to respond with a 403 status code?

Unless I'm missing something, you don't send any visible response. You're just sending the header which the browser does not render. If you read 404 to Apache, it was stated that Apache ignores the result code from CGI it will not actually return the 403 page. Apache just sends the response code along. You need to find the page from the config and return it yourself.

grep
1)Gain XP 2)??? 3)Profit


Comment on Re: Need to respond with a 403 status code?
Re^2: Need to respond with a 403 status code?
by JCHallgren (Sexton) on Apr 19, 2007 at 16:51 UTC
    I had read the other thread, but didn't follow everything, given my knowledge level...

    So if the header contains the 403 code, then a bot might hopefully interpret that correctly and go away (hopefully!)?

    BTW, There are certain types of data errors that I want to reply with this fake reply, while for other 'normal' errors, I have a nice formatted page that I use, so determining which to send needs to occur within my CGI script, as I see it.

    I'm also presuming that I could output a minimal "Access Forbidden" page with this response code, so a browser user would see that?
    As the standard config error page (I believe) gives an email addr, which I don't want to provide in this case.
      So if the header contains the 403 code, then a bot might hopefully interpret that correctly and go away (hopefully!)?

      One would think so, but at the very least you're not wasting bandwidth sending real content.

      grep
      1)Gain XP 2)??? 3)Profit

Re^2: Need to respond with a 403 status code?
by bart (Canon) on Apr 19, 2007 at 21:00 UTC
    I think it doesn't have to be the 403 page that Apache would have sent, it may just be one you made yourself, and which somewhat looks like a 403 error page.

    Besides, as error pages can always be customized, there's no need for it to ever be the real 403 page.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://610983]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2014-07-23 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (152 votes), past polls