By at02 on
I have clean urls enabled on my site, but as soon as I enabled it I was unable to go to the "administration" page. Strangely, this ONLY applies to the admin page, not subpages nor any other link on the site. I can access it by adding in the "?q=" part, but this is a bit of a hassle.
The error I get is:
"403 Permission Denied
You do not have permission for this request /admin/"
Any ideas as to why this is and what to do?
Comments
Please make sure you don't
Please make sure you don't accidentally have an (empty) 'admin'-folder in the root of your Drupal installation, nor that your settings/host/server automatically redirects /admin/ to some other (inaccessible) location.
settings.php
ftp to >> /htdocs/sites/default/settings.php
and enable the base url - see bottom line; remember to change permissions
to 777 to edit/overwrite and then once changed back to 444 to lock it.
* Base URL (optional).
*
* If you are experiencing issues with different site domains,
* uncomment the Base URL statement below (remove the leading hash sign)
* and fill in the URL to your Drupal installation.
*
* You might also want to force users to use a given domain.
* See the .htaccess file for more information.
*
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
# $base_url = 'http://www.example.com'; // NO trailing slash!
$base_url = 'http://example.com';That should fix it - if not and you're locked out - log into your mysqldb and edit table "variable", field "clean_url"; if you can't locate do search for all tables for "clean_url" then edit entry - set from 1 (true) to 0 (false) like this
>>BEFORE:
s:1:"1";AFTERS:1:"0";This will get you back in with clean url's disabled. I'm pretty sure the base url option will fix your issue when you reenable clean_urls.
For more info see >> http://drupal.org/node/5590
What do you mean? How do I
What do you mean? How do I enable the base_url thing? I can find it in the code and enable it to be written on, but I don't know how to enable the base_url deal.
What I really don't understand is *why* is it just the admin page that needs the "?q=admin/" ... when subsequent pages and every other page on the website can work just fine with clean URLS.
clean_urls and admin account
Issue is: after enabling clean urls you were no longer able to access your admin account pages (i.e. account login, admin pages, etc). You might also have issues with appearance of pages, stripped of css/themes? You rec'd error 403 pages instead. So basically you have two problems. The first problem is you're locked out of your admin account - so you want to restore that. And the second problem is that the first problem came as result of enabling clean_urls, so disable clean_urls and find a fix to reenable at some point?
Manually disable clean_urls temporarily to regain access to your admin account/pages. To do this:
(1.) log into your mysql db with your mysql account and password. Search the drupal designated database for the variable "clean_url". It should be in the variable table. Edit the value in the field "clean_url" - replace the 1 with a 0 (i.e. 1 is on/true, 0 is off/false).
So basically unedited the clean_url value is: s:1:"1"; When you turn clean_url's off by replacing 1 with 0, it will look like this: s:1:"0";
Save changes and logout of mysql.
The options are turned on/off via the admin pages in drupal. The values
for those options (1/0, true/false, on/off) are stored in the db. You're just bypassing drupal altogether and editing the db manually to tell it what options you want enabled/disabled.
(2.) Now you should have access to your drupal admin pages. Clean urls are disabled. And everything is working.
(3.) How do I enable the base_url thing? uncomment the code by removing # in front of line
Below is copy of base url section in the settings.php file:
* Base URL (optional).
*
* If you are experiencing issues with different site domains,
* uncomment the Base URL statement below (remove the leading hash sign)
* and fill in the URL to your Drupal installation.
*
* You might also want to force users to use a given domain.
* See the .htaccess file for more information.
*
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
# $base_url = 'http://www.example.com'; // NO trailing slash!
$base_url = 'http://example.com';
So if you read the file you'll see directions, examples; uncomment the line and customize for your site
This code is in the settings.php file which is located in /htdocs/sites/default/settings.php. You can't save changes to the file until you change file permissions. FileZilla will let you edit permissions as the file sits on the server - so you can change the permissions then download copy locally, then edit, then upload then change permissions to lock it down. If you can't do this then download settings.php locally, remove read-only, edit, save, add read-only, then upload.
For more info see >> http://drupal.org/node/5590
Does this help?
Issue is: after enabling
No. He only has problems accessing www.example.com/admin. But not www.example.com/user nor www.example.com/admin/settings or other clean-url-pages.
Therefore the problem lies with the host. The host claims (by httpd.conf or other means) wwww.exampleaccountofcustomer.com/admin. You could inform with your host whether they do something like that, or you could temporarily remove your drupal installation and test whether you still get a Access Denied on admin although the entire http-root-folder is empty (make sure you check for hidden files).
Or you could disable Clean URLs entirely at http://example.com/admin/settings/clean-urls
how about this?
http://drupal.org/node/304484
Found some ideas that might work on >> http://drupal.org/search/node/rename+admin+url
No. He only has problems
She you mean. And yes, this is exactly the problem.
Now that I know what it is, I deleted the admin folder in the webroot, and solved the problem. This was exactly what I needed, thanks for the link!
Thanks everyone for all the help! :)
She you mean. And yes, this
this helped
..me get out of a hole I dug myself into by transferring an intranet between servers
Hello, how this worked. Can
Hello, how this worked. Can you please explain.
Thanks
Thank you. Thank you. Thank you.
Seriously. I've been futzing with this for a few hours. Modifying my .htaccess file, modifying to AllowOverride All, and so on.
What a simple solution (can't belive I overlooked it...).
What's that saying? when you hear hoofbeats, think horses, not zebras.
Again, thanks so much.