i want to rewrite my custom plugin url

Do you actually need the URL? Such URLs are needed only if you want the search to be indexed. Example: Check this. (That ‘a’ in the url comes from the search form in this page and the homepage)
The ideal way for parsing a form is to use the init action hook instead of setting the form action. If you still want the custom URL, let me know and I’ll tell you a solution!

Assuming only the client name will change.


add_filter('init', 'add_page_rewrite_rules');
function add_page_rewrite_rules()
    global $wp_rewrite, $wp;

    //this will hold the text field data

    //the actual rule

Now make a WP page with slug as client-data. This is required for the rule to work. Make a page template, assign it to this page. Make sure the following 2 lines are in the page template.

global $wp, $wp_query;
$name = get_query_var('client_name');

The $name var will have the client name you pass in the URL, use it to do the processing as you would using the form data. You can either use jQuery to handle the form submit and redirect to this custom URL or you can use the init action to check the form submit and use a hard redirect to this URL. Using PHP the redirect URL should be

echo home_url('/Projects/demos/demo-url-rewrite/client/'.$_POST['name']);

Let me know how it goes!