Redirection not working properly

This topic contains 8 replies, has 3 voices, and was last updated by  Mical Johnson 5 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #480999

    Mical Johnson
    Expired Member
    Post count: 45

    Hi our site url is : https://theinnkeeper.com

    We needed to have ‘United States’ to come up at the default home page. Finding no other way in the plugin to do so, we used a redirection plugin and set the following URL as the redirection URL for the home page:
    https://theinnkeeper.com/location/united-states/

    But now, every time we use https://theinnkeeper.com, we end up here: https://theinnkeeper.com/location/united-states/georgia/atlanta/

    It always adds /georgia/atlanta/ on it’s own. Never stop at /united-states/ only which we need it to do. Can you plz help? Can anyone tell us why this is happening and how we can achieve the desired result?

    Thanx in advance.

    #481000

    Mical Johnson
    Expired Member
    Post count: 45

    FYI, when we first installed the plugin, we added Atlanta as the default city as it was required by the plugin to set a default city. But we don’t need any specific city to show up at the home page. How can we stop that? Just need United States in the default home page …

    #481060

    Alex Rollin
    Moderator
    Post count: 27815

    Instead of a redirect you could use GD Map and GD Listings on a WP Page and set the map and gd listings to use IN United Stated only.

    https://wpgeodirectory.com/docs-v2/integrations/maps/#location

    If there is a problem with the redirect, you could try switching toa relative or absolute URL.

    I agree it should not go on to Atlanta, but V2 doesn’t have settings for redirection at all. The URL for the USA looks right so it must be in the redirect code.

    #481236

    Mical Johnson
    Expired Member
    Post count: 45

    I’m sorry, I should have mentioned that I’m still using V1 … we are waiting on V2 since it’a major upgrade. Is there anything I can do to fix this issue in V1 ?

    Thanx in advance.

    #481238

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #481255

    Mical Johnson
    Expired Member
    Post count: 45
    This reply has been marked as private.
    #481670

    Mical Johnson
    Expired Member
    Post count: 45
    This reply has been marked as private.
    #481736

    Kiran
    Moderator
    Post count: 7069

    Hello Mical,

    There is a option in GeoDirectory > Advance Search to redirect page on a first time visit to the site. Currently it has enabled to redirect to default location, so it redirects the default city on first time visit.

    Use following PHP code snippet to redirect to default country page instead of default city.

    
    
    function _gd_custom_advanced_search_js_msg( $params ) {
    	if ( ! empty( $params['onload_redirectLocation'] ) ) {
    		$params['onload_redirectLocation'] = trailingslashit( geodir_get_location_link( 'base' ) ) . 'united-states/';
    	}
    
    	return $params;
    }
    add_filter( 'geodir_advanced_search_js_msg', '_gd_custom_advanced_search_js_msg', 10, 1 );

    Kiran

    #482838

    Mical Johnson
    Expired Member
    Post count: 45

    It worked! Thanx very much.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount