Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Apr 2008
    Location
    sanctum sanctorum
    Posts
    152

    Question Modifiying 406 error messages triggered by Mod Security

    How can I modify the 406 returned by Mod Security triggers?

    I am able to modify most other error documents on per domain basis by placing ErrorDocument directive to respective .htaccess files, and they work with the exception of 406 errors.

    For example, in domain dummy.com docroot I have the following in .htaccess:
    ...
    ErrorDocument 404 /[path_to_doc] (this works)
    ErrorDocument 406 /[path_to_doc] (this does not)
    ...

    When Mod Security triggers on dummy.com, a 406 is returned but it is not the customised 406 document given by ErrorDocument directive above


    Thanks

  2. #2
    Member rhenderson's Avatar
    Join Date
    Apr 2005
    Location
    Oklahoma
    Posts
    742

    Default

    Have you just tried 406.shtml in the root public_html? Just a thought.
    Regards,
    Randy
    Affordable Web Hosting
    _________________________

  3. #3
    Member
    Join Date
    Apr 2004
    Posts
    220

    Default

    well you don't want to copy the same file over and over again on all hosting account right?
    HalfDedi.com : Half Dedicated Half Price
    We Provide Affordable VPS hosting solution in US and Singapore

  4. #4
    Member SuperBaby's Avatar
    Join Date
    Nov 2003
    Location
    Malaysia
    Posts
    306

    Default

    If it is for just one or two accounts, just edit look at the mod_security log which 406 page it is directing to. Then modify that page. This way, you do not need to edit your htaccess to include ErrorDocument 406 /[path_to_doc].
    SuperBaby

  5. #5
    Member rhenderson's Avatar
    Join Date
    Apr 2005
    Location
    Oklahoma
    Posts
    742

    Default

    Quote Originally Posted by markhard View Post
    well you don't want to copy the same file over and over again on all hosting account right?
    I appeared by the poster (since they were talking about an .htaccess file) this was for one account, but I could be wrong.
    Regards,
    Randy
    Affordable Web Hosting
    _________________________

  6. #6
    Member
    Join Date
    Apr 2008
    Location
    sanctum sanctorum
    Posts
    152

    Thumbs up Solved

    Thanks for your replies. It turns out that it was the interaction with mod security. Any rule triggered in Phase 1 was causing the main server error documents to be served and not the ones defined in .httaccess in each virtual host ( because during P1 URL transformation is not yet performed by apache). Moving those rules to phase 2 resolved the issue. Thanks again.

Similar Threads & Tags
Similar threads

  1. mode security code 406 error
    By k-planethost in forum Optimization
    Replies: 2
    Last Post: 03-29-2011, 10:25 AM
  2. Mod Security blocks Lynx browser with 406 Not Acceptable
    By anoetic in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 02-10-2008, 12:25 PM
  3. 406 error, how to solve?!
    By AvatarDutch in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 12-29-2007, 11:23 AM
  4. Simple security question about mod-security rule sets.
    By jols in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-09-2007, 04:37 AM
  5. 406 - Not Acceptable Error
    By ukpro in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-01-2005, 12:49 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube