.htaccess - wordpress plugin development to add in htaccess file -


i'm developing plugin in wordpress needs add htaccess code used insert_with_markers it's writing htaccess adds on bottom of htaccess file need add code on top of htaccess file. how do this?

you have prepend htaccess rules want add exisiting rules. the:

function my_htaccess_contents( $rules ) {     $my_content = <<<eod     \n # begin added content     # protect wpconfig.php     <files wp-config.php>       order allow,deny       deny      </files> # end added content\n eod; return $my_content . $rules; } add_filter('mod_rewrite_rules', 'my_htaccess_contents'); 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -