如何创建重定向programatically
从…起
http://www.myweb.com/myvendor/frame
至
http://www.myweb.com/wp-content/plugins/myvendor/frame.php
在我的模块中?
我正在努力
function myvendor_plugin_activate() {
myvendor_plugin_rules();
flush_rewrite_rules();
}
function myvendor_plugin_deactivate() {
flush_rewrite_rules();
}
function myvendor_plugin_rules() {
add_rewrite_rule(\'^myvendor/frame/([a-zA-Z]+)$\', \'wp-content/plugins/myvendor/frameoctmethod=$1&%{QUERY_STRING} [QSA,L]\', \'top\');
}
register_activation_hook(__FILE__, \'myvendor_plugin_activate\');
register_deactivation_hook(__FILE__, \'myvendor_plugin_deactivate\');
add_action(\'init\', \'myvendor_plugin_rules\');
但不起作用,且重写规则不显示在配置表中(rewrite\\u rules)
有什么想法吗?