In Codex I found that the best action to call add_rewrite_rule is the init action. So in this way the function is called every time the site load. But to save the rule in rewrite_rules option it would be better to call it in register_activation_hook?
1 Answer
Rules should be added on init
because other code might flush rewrite rules, which would cause your rules to disappear.