Access Denied Error for Drupal 'update.php' page
To be honest, I feel rather foolish. This is a problem I've been having with Drupal on and off: I click on the 'Run Updates' menu item in the Adminstration Menu and every now and then I get an access denied error. Since I have access to the server, I was changing the settings.php/update.php file to allow me access to run update.php (see here: Running Update.php). This was annoying me, but it only happened occasionally, so I lived with it.
Today, I figured out what the problem was. I don't use the 'www.' in front of most of the sites I visit, and I would pretty much never type it into my browser. Assuming that the server on the far end is configured correctly, this is not a problem (the few times it doesn't work, it annoys me, an irrationally large amount). When I visit my own sites, I don't use the 'www.' either. When I login as the admin for my sites, I still do not have the 'www.' in front of the domain name. The problem is, Drupal authentication treats 'www.example.com' as a different domain from 'example.com'. This means, if I login as user 1 while at 'eoinbailey.com' but try to run 'www.eoinbailey.com/update.php' I will receive an access denied error.
If you delete (or add) 'www.' from the front of the domain name, you will have your access again. PROBLEM SOLVED!



Comments
Post new comment