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
3534
votes
22 answers

403 Forbidden vs 401 Unauthorized HTTP responses

For a web page that exists, but for which a user does not have sufficient privileges (they are not logged in or do not belong to the proper user group), what is the proper HTTP response to serve? 401 Unauthorized? 403 Forbidden? Something else? What…
573
votes
34 answers

Error message "Forbidden You don't have permission to access / on this server"

I have configured my Apache by myself and have tried to load phpMyAdmin on a virtual host, but I received: 403 Forbidden You don't have permission to access / on this server My httpd.conf # # This is the main Apache HTTP server configuration file.…
Dmytro Zarezenko
  • 10,526
  • 11
  • 62
  • 104
289
votes
21 answers

Nginx 403 error: directory index of [folder] is forbidden

I have 3 domain names and am trying to host all 3 sites on one server (a Digital Ocean droplet) using Nginx. mysite1.name mysite2.name mysite3.name Only 1 of them works. The other two result in 403 errors (in the same way). In my nginx error log, I…
Ryan
  • 22,332
  • 31
  • 176
  • 357
228
votes
11 answers

Nginx 403 forbidden for all files

I have nginx installed with PHP-FPM on a CentOS 5 box, but am struggling to get it to serve any of my files - whether PHP or not. Nginx is running as www-data:www-data, and the default "Welcome to nginx on EPEL" site (owned by root:root with 644…
Angus Ireland
  • 2,385
  • 3
  • 22
  • 21
181
votes
12 answers

Problem HTTP error 403 in Python 3 Web Scraping

I was trying to scrape a website for practice, but I kept on getting the HTTP Error 403 (does it think I'm a bot)? Here is my code: #import requests import urllib.request from bs4 import BeautifulSoup #from urllib import urlopen import re webpage =…
Josh
  • 3,231
  • 8
  • 37
  • 58
142
votes
3 answers

How to fix "403 Forbidden" errors when calling APIs using Python requests?

I needed to parse a site, but I got a 403 Forbidden error. Here is the code: url = 'http://worldagnetwork.com/' result = requests.get(url) print(result.content.decode()) The output is: 403 Forbidden
131
votes
12 answers

Apache VirtualHost 403 Forbidden

I recently tried to set a test server up with Apache. The site must run under domain www.mytest.com. I always get a 403 Forbidden error. I am on Ubuntu 10.10 server edition. The doc root is under dir /var/www. The following are my settings: Content…
Yuchen Wang
  • 1,682
  • 2
  • 14
  • 16
102
votes
26 answers

WAMP 403 Forbidden message on Windows 7

I have installed WAMP version 2.1 on my windows 7 machine. When i browse to localhost in my browser, the WAMP server page is visible. But when I browse to my IP in my browser, I get the message 403 Forbidden: You don't have permission to access /…
Jake
  • 16,329
  • 50
  • 126
  • 202
91
votes
18 answers

MVC4 HTTP Error 403.14 - Forbidden

I have build a .net4.5 ASP.NET MVC4 web app which works fine locally (IIS Express & dev server) but once i deploy it to my web server it throws the 403 error. I have installed .Net 4.5RC on the server and even tried the aspnet_regiis -i bit that…
mithun_daa
  • 4,334
  • 5
  • 38
  • 50
85
votes
11 answers

Emulate a 403 error page

I know you can send a header that tells the browser this page is forbidden like: header('HTTP/1.0 403 Forbidden'); But how can I also display the custom error page that has been created on the server for this type of error? By default, just sending…
NightHawk
  • 3,633
  • 8
  • 37
  • 56
75
votes
16 answers

Why does Nginx return a 403 even though all permissions are set properly?

I have Nginx setup and displaying the test page properly. If I try to change the root path, I get a 403 Forbidden error, even though all permissions are identical. Additionally, the nginx user exists. nginx.conf: user nginx; worker_processes …
Adam Pearlman
  • 971
  • 1
  • 9
  • 16
65
votes
4 answers

403 Forbidden with Java but not web browser?

I am writing a small Java program to get the amount of results for a given Google search term. For some reason, in Java I am getting a 403 Forbidden but I am getting the right results in web browsers. Code: import java.io.BufferedReader; import…
tckmn
  • 57,719
  • 27
  • 114
  • 156
61
votes
1 answer

What is the most appropriate HTTP status code to return if a required header is missing?

I read What HTTP status response code should I use if the request is missing a required parameter? but it did not specifically ask about headers and there didn't seem to be a consensus. The context of this question assumes successful authentication.…
57
votes
5 answers

Apache gives me 403 Access Forbidden when DocumentRoot points to two different drives

I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the apachefriends release. This is my httpd-vhosts.conf file:…
RobbieGee
  • 1,581
  • 4
  • 15
  • 17
57
votes
2 answers

Any way to get the response body during HTTP errors?

I'm hitting an API that will occasionally throw a HTTP 403 error, and the response body can give some extra information in the form of json, however for the life of me I can't seem to get the information back out from the Alamofire response objects.…
Kevin DiTraglia
  • 25,746
  • 19
  • 92
  • 138
1
2 3
99 100