Is this plugin compatible with a reverse proxy setup?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Is this plugin compatible with a reverse proxy setup?

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #39312

    We are currently using a reverse proxy on our site. Our CMS url is but visitors come to

    The search bar is implemented on our Personal Finance Blog page. The search results show up perfectly fine on the cms.netpayadvance URL, but since visitors are only seeing, they’re not seeing the live search results and when actually searching for a keyword, the search bar redirects to our link instead of

    Is there a way to get the search bar to pull up the results with the URL?

    Ernest Marcinko
    Ernest Marcinko


    I believer the simplest solution to this is using a small custom code snippet to change the resutl URLs from the “cms.” subdomain to the main.

    Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    add_filter( 'asp_results', 'asp_custom_link_results', 10, 4 );
    add_filter( 'asp_noajax_results', 'asp_custom_link_results', 10, 4 );
    function asp_custom_link_results( $results, $search_id, $is_ajax, $args  ) {
    	// Array of original -> replacement links
    	$replace = array(
    		'cms.netpayadvance' => 'netpayadvance',
    	foreach ($results as $k=>&$r) {
    		$link = isset($r->link) ? $r->link : (isset($r->asp_guid) ? $r->asp_guid : '');
    		if ( $link == '' )
    		$link = str_replace(array_keys($replace), array_values($replace), $link);
    		// Ajax results link
    		if ( isset($r->link) ) {
                $r->link = $link;
    		// Results page link
    		if ( isset($r->asp_guid) ) {
                $r->asp_guid = $link;
      return $results;
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.