add_rewrite_rule questions
add_rewrite_rule questions
add_rewrite_rule questions
It was caused by the nginx rewrite rules, I thought I checked them but eventually I missed the most obvious one :s
Leave your activation function as it is, and create another for the rewrite rules hook: function wpse_209303_rewrite_rules( $wp_rewrite ) { $wp_rewrite->add_external_rule( ‘(.+)\.([0-9\.\-\_]+)\.(js|css)$’ , ‘$1.$3’); } add_action( ‘generate_rewrite_rules’, ‘wpse_209303_rewrite_rules’ );
SOLVED by somebody: “if my form pointed to a directory: http://example.com/wordpress then my POST data disappeared and $_POST was empty. If I pointed to a specific file: http://example.com/wordpress/index.php Then it worked properly.” ps: God bless him. 🙂
Permalink structure not working with Custom Taxonomy (URL like ./taxonomy/category/postname)
Any way to make Apache’s internal redirect work?
When you visit a frontend page, WordPress will query the database and if your page does not exist in the database, that query is not needed and is just a waste of resources. Luckily, WordPress offers a way to handle frontend requests in a custom way. That is done thanks to the ‘do_parse_request’ filter. Returning … Read more
Well this is silly but I figured it out. I removed the last / from the pattern and now it works as expected. Code is now… add_rewrite_rule(‘^coaching/apply’, ‘index.php?page_id=5156’, ‘top’); Seems weird to me that ^coaching/apply would work but not ^coaching/apply/ esp when entering example.com/coaching/apply/ as the url works.
this worked for me ‘has_archive’=> true, replace it with ‘has_archive’=> ‘jobs’, then flushed the permalinks
I managed to find a solution thanks to Milo‘s previous answers on other related questions. I found this particular post Remove base slug in CPT & CT, use CT in permalink to be extremely helpful. My initial CPT with grandparent relationship rewrite remains the same: function cpt_child(){ $args = array( //code ‘rewrite’ => array( ‘slug’ … Read more