0
这是我的代码:(使用默认的WP主题:twentyfourteen)WordPress的重写non_wp_rules
function my_rewrite_rules($wp_rewrite) {
$non_wp_rules = array(
'assets/(.*)' => 'wp-content/themes/twentyfourteen/assets/$1',
);
$wp_rewrite->non_wp_rules = $non_wp_rules + $wp_rewrite->non_wp_rules;
}
function my_flush_rewrite_rules() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
add_action('init', 'my_flush_rewrite_rules');
add_action('generate_rewrite_rules', 'my_rewrite_rules');
现在,我访问链接:
mysite.domain/wp-content/themes/twentyfourteen/assets/css/global.css => //yes, base css file
mysite.domain/assets/css/global.css => //not working
有人能帮助我吗?