General help

The dreaded 403 Forbidden error on mod/book/edit.php

 
Picture of Christos Patsatzis
The dreaded 403 Forbidden error on mod/book/edit.php
 

Greetings to all,

On my 2.4.1 moodle, I get the error

Forbidden

You don't have permission to access /e-learning/mod/book/edit.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

The problem seems to appear when i try to create text inside TinyMCE which contains more than one paragraph (that is, more than one <p> </p>). The length of text inside one <p> doesn't seem to affect it, neither does the use of the word "set" that many others noticed in similar conditions.

 I tried the .htaccess hack, no luck though.

If it is of any help, my moodle is hosted at a linux server, with cpanel and mod_security enabled.

My problem lies (as far as I have noticed) only at book/edit and not in mod/quiz or elsewhere.

Any suggestions?

Thanks a lot,
Chris

 
Average of ratings: -
My Hero
Re: The dreaded 403 Forbidden error on mod/book/edit.php
Plugin developers

I'm not sure if this helps, but I occasionally get the exact same error. Every time it happens it is due to a rule in the server's mod_security file.  

I would try this - try to get that error to happen again and contact your hosting company with the time and URL and ask them to check if a mod_security rule was tripped.  If it was, ask them to whitelist the rule.

See this for more information on mod_security: https://moodle.org/mod/forum/discuss.php?d=95086

 

 
Average of ratings: -
Picture of Christos Patsatzis
Re: The dreaded 403 Forbidden error on mod/book/edit.php
 

Thanks Paul, I guess it also applies to my situation as I checked the file/directory permissions and they are correct.

I will contact my hosting company and update this thread with info.

Chris

 
Average of ratings: -
Picture of Christos Patsatzis
Re: The dreaded 403 Forbidden error on mod/book/edit.php
 

Well, Paul you are right.

mod_security was to blame for this error. Hosting company whitelisted the location and everything is normal.

To sum up, if anyone stumbles upon this thread, for unexpected 403 errors in a particular action-location, check out:

1) Your file and directory permissions (644 is fine for files, 755 for directories i think)

and

2) If mod_security has been enabled on your server. You can ask your hosting company about this, and tell them to whitelist a particular location (as Paul correctly suggested). Try also the .htaccess hack but if your server has been configured to not allow the htaccess override, this won't work.

Chris

 

 
Average of ratings: -