[resolved] [Plugin: GRA4 Social Network] rewrite_rules_array. 404 with POST (2 posts)

  1. trof
    Posted 4 years ago #

    Hi all.

    In my plugin I'm doing something like

    function gra4_set_seo_friendly_rules($args)
    	$new = array();
    	$new['(gra4)(/[-/0-9a-zA-Z]+)?/(.*)$'] = 'index.php?pagename=$matches[1]';
    	return $new + $args;
    add_filter("rewrite_rules_array", "gra4_set_seo_friendly_rules");

    I also do $wp_rewrite->flush_rules(); on init.
    I guess it should cover all URLs 'longer' than my plugin page (the plugin inserts content into a page),so anything like:
    pretty much is reflected to:
    with no 404 pages.
    That's pretty much how it works. Well, almost =)
    On some URLs it still fires 404. What really surprises me, it happens only when POST data is present - the same page with GET only works ok. It also happens not to all URLs (so far I discovered only two malfunctions, allthough both with plenty of POST data), majority POST pages work just fine.
    I commented all my code out... well, it does not matter, I guess when I see This is somewhat embarrassing, isn’t it? it does not even hit my code yet, right?

    Any ides? I kinda lost, don't even know where to start digging...

    Thank you.

  2. trof
    Posted 4 years ago #

    Well, I solved it:
    WordPress does not like forms with input fields with <... name="name" ...>

    Works fine now: http://wmexp.com/wordpress/gra4/

Topic Closed

This topic has been closed to new replies.

About this Topic