Questions tagged [http-status-code-403]

The 403 or "Forbidden" error message is a HTTP standard response code indicating that the request was legal and understood but the server refuses to respond to the request.

A 403 Forbidden may be returned by a web server due to an authorization issue or other constraint related to the request. File permissions, lack of encryption, and maximum number of users reached (among others) can all be the cause of a 403 response.

2271 questions
55
votes
8 answers

Screen scraping: getting around "HTTP Error 403: request disallowed by robots.txt"

Is there a way to get around the following? httperror_seek_wrapper: HTTP Error 403: request disallowed by robots.txt Is the only way around this to contact the site-owner (barnesandnoble.com).. i'm building a site that would bring them more sales,…
55
votes
2 answers

Can't access /elmah on production server with Elmah MVC?

I installed the elmah.mvc nuget package and kept the default configuration of that sans setting up sending an email and plugging it into a SQL database. On my local machine when I use the Visual Studio host, I can open my app and access /elmah fine…
SventoryMang
  • 10,275
  • 15
  • 70
  • 113
53
votes
7 answers

Django returns 403 error when sending a POST request

when I'm using following Python code to send a POST request to my Django website I'm getting 403: Forbidden error. url = 'http://www.sub.example.com/' values = { 'var': 'test' } try: data = urllib.urlencode(values, doseq=True) req =…
Djent
  • 2,877
  • 10
  • 41
  • 66
53
votes
4 answers

"Error 403: access_denied" from Google authentication web api despite google account being owner

I'm using the default code provided from google here, and I don't quite understand why its not working. The code outputs the prompt Please visit this URL to authorize this application: [google login URL]. When attempting to log in with the account…
khan simeoni
  • 633
  • 1
  • 4
  • 6
49
votes
7 answers

Apache2 virtualhost 403 forbidden?

I'm running ubuntu 13.04 64bit on my desktop, I installed Apache2, MySQL and PHP etc. I wanted to have my web root in /home/afflicto/public_html instead of /var/www. So I went along with this…
Petter Thowsen
  • 1,697
  • 1
  • 19
  • 24
47
votes
5 answers

HttpURLConnection reading response content on 403 error

When I fetch data from an URL with a 403 response is = conn.getInputStream(); It throws an IOException and I can't get the response data. But when I use firefox and access that url directly, The ResponseCode is still 403, but I can get the html…
yava
  • 2,511
  • 3
  • 20
  • 17
47
votes
7 answers

Apache localhost 403 error with Yosemite

I've just installed Mac OS X Yosemite fresh. I configured Apache and chmodded "users/user/Sites" to 755. When I hit localhost I receive a 403 Forbidden "You don't have permission to access / on this server". The same thing occurs with any other…
Zach Shallbetter
  • 1,901
  • 6
  • 23
  • 37
41
votes
10 answers

Asp.Net web service: I would like to return error 403 forbidden

I have got a web service programmed in c# / asp.net. [WebService(Namespace = "http://example.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] [System.ComponentModel.ToolboxItem(false)] public class Service:…
bernhardrusch
  • 11,670
  • 12
  • 48
  • 59
40
votes
4 answers

Access denied: 403 or 404?

What status code should be returned if somebody request access to the entity that he is not permitted to see? You'll probably say it's 403: Forbidden. But is it common practice to return 404 instead? I don't want somebody know that this entity even…
Robo Robok
  • 21,132
  • 17
  • 68
  • 126
40
votes
10 answers

Fetch a Wikipedia article with Python

I try to fetch a Wikipedia article with Python's urllib: f = urllib.urlopen("http://en.wikipedia.org/w/index.php?title=Albert_Einstein&printable=yes") s = f.read() f.close() However instead of the html page I get the following response:…
dkp
  • 825
  • 3
  • 9
  • 14
37
votes
3 answers

401 Unauthorized vs 403 Forbidden: Which is the right status code for when the user has not logged in?

After lots of Googling and Stackoverflowing, it still isn't clear to me because many articles and questions/answers were too general (including 403 Forbidden vs 401 Unauthorized HTTP responses which was not specifically for my use-case). Question:…
37
votes
6 answers

How do I return a 403 Forbidden in Spring MVC?

I want my controller to return the right HTTP response code when the user lacks permission to view a particular page.
Will Harris
  • 21,597
  • 12
  • 64
  • 64
34
votes
4 answers

Spring WebSocket Connecting with SockJS to a different domain

WebSockets in Spring is a rather new topic that I;m tiring to find a bit more. My problem is with connecting to a service from a different domain, I'm working on with Lineman building the front-end side and Spring Boot when doing the back-end side,…
Sniady
  • 1,633
  • 1
  • 12
  • 21
32
votes
4 answers

Send a 404 error via htaccess?

I'd like to cut off access to a subdirectory on my site but I want any access in the subdirectory to be a 404 error, not a 403 forbidden. How can this be accomplished?
Citizen
  • 12,430
  • 26
  • 76
  • 117
31
votes
4 answers

Instagram/feed API media URL shows 'URL signature expired'

I am using Instagram feed API to show my Instagram posts on my Website. But some video URL shows 'URL signature expired'. Any solution for me ?