Skip to main content

mod_rewrite LOOP [N] Flag

Comments

6 comments

  • zye
    and just 4 info - the apache RLimitMEM is not working - limits are set but the process just grows and grows in mem
    0
  • cPanelMichael
    is there any way to DEACTIVATE the [N] Flag in mod_rewrite ?

    Hello :) Could you elaborate on this? For instance, what's the difference between deactivating it and simply removing it from your rules? Thank you.
    0
  • zye
    as it is now any customer who uses the rule can bring my server down. thats why i like to just remove the Flag N so no loop is possible.
    0
  • cPanelMichael
    It's not possible to disable this flag from the documentation I've reviewed. However, you could disable Mod_Rewrite for individual accounts that are utilizing rules which generate issues with Apache. Edit: Corrected Mod_Security to Mod_Rewrite Thank you.
    0
  • quizknows
    It's not possible to disable this flag from the documentation I've reviewed. However, you could disable Mod_Security for individual accounts that are utilizing rules which generate issues with Apache. Thank you.

    What does Mod_Security have to do with this? I can't see any reason to disable it in this scenario. Anyway, there is a redirect limit of 10 by default, more info on this can be found here: core - Apache HTTP Server Version 2.4 You could try lowering it but that really shouldn't be necessary.
    0
  • gryzli
    What does Mod_Security have to do with this? I can't see any reason to disable it in this scenario. Anyway, there is a redirect limit of 10 by default, more info on this can be found here: core - Apache HTTP Server Version 2.4 You could try lowering it but that really shouldn't be necessary.

    I don't think this limit will apply for the situation described. In fact for Apache 2.2.x I'm 100% sure it doesn't work. The -N flag tells mod_rewrite to start from beginning parsing the .htaccess file, which it seems doesn't increment the internal redirect counter. The memory leak resulting from "bad used" -N flag is a "100 year problem". For me the most convenient way of fixing this "bad behaviour" is to manually patch Apache and disable/limit the option.
    0

Please sign in to leave a comment.