404 error for country links

This topic contains 19 replies, has 3 voices, and was last updated by  clem 7 years, 2 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #347593

    clem
    Buyer
    Post count: 87

    Hi !

    In my website, I have created 1 page per continent and in each page I have 1 link per country

    My link is like that : http://mywebsite.com/places/egypt/

    but If I haven’t created a place in the country, I have a 404 error when I click on it.

    So I’m going to create 1 “fake” place per country, lot of work …

    Before starting that I just want to be sure there isn’t another way to make all my country links working

    I have noticed that when I have created a place even if I delete it right away, the link is still working (I have the message “no places found” as expected)

    Thanks

    Clément

    #347616

    Guust
    Moderator
    Post count: 29970

    Country links will not work until you have at least one location in that country.
    Then the URL will be yoursite.com/slug-of-your-location-page/country-slug

    Please review these links:

    https://wpgeodirectory.com/docs/layout/#directory

    https://wpgeodirectory.com/docs/manage-location/#edit

    https://wpgeodirectory.com/docs/location-manager-shortcodes/#switch
    http://wordpressmu-3822-8567-17899.cloudwaysapps.com/try-geodirectory/all-locations/

    Let us know how you went.

    #347629

    clem
    Buyer
    Post count: 87

    Ok Thanks, I read and understood better how it works !

    In fact I don’t need to create 1 place per country and then delete it, I just need to go to the multi location menu and adding 1 new location per country ! so much faster 🙂

    #347696

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

    #353639

    clem
    Buyer
    Post count: 87

    Hi Guust !

    I have finished to add all the locations, so now I haven’t the problem with the 404 error page redirection anymore

    However I still have a problem I can’t understand :

    For some country it works perfectly, when I click on the link I have created (ex: monsite.com/place/spain), I’m redirected on a page where I see only the place of that country

    But for some countries, even if I have some places added, I have the message : no records found

    I also have noticed :

    1- when It works, in the search bar, “near” is replaced by “in Spain (country)” and this field is green but when it doesn’t work, the “near” still appear but the field is also green

    2- For some countries who work, sometimes it’s the whole world map with just the places of the country and sometimes the map is focus only on the country (I would like to have the map focus on the country for all countries …)

    I did exactly the same for all countries :

    1- I created a page for the 5 continents

    2- In that pages, I created 1 link for each country (my site.com/places/spain)

    3- Through the multiplications settings, I created 1 place for each country

    So I don’t understand why it works for some countries and not for the others …

    #353647

    clem
    Buyer
    Post count: 87
    This reply has been marked as private.
    #353818

    Guust
    Moderator
    Post count: 29970

    /places/thailand-1
    /places/ukraine-1
    /places/india-1

    See more at these links:
    https://wpgeodirectory.com/docs/faqs/why-do-my-locations-get-a-1-at-the-end/
    https://wpgeodirectory.com/docs/manage-location/#edit

    It might be simpler just to add the location switcher:
    https://wpgeodirectory.com/docs/multilocations/#main

    #354210

    clem
    Buyer
    Post count: 87

    Exactly, thanks for your help Guust

    Indeed, all the countries where I have added places few weeks ago have slugs without -1 but all the country I have added the first place recently have slug with -1

    I just have to add the -1 at those country links and it works 🙂

    I still have a problem, when I am in a country listing result page and I switch language (I use WPML) I’m redirected to the 404 error page

    Maybe only because yet I haven’t translated the countries in the multi location add-on, I will try it in the next couple of days …

    #356162

    clem
    Buyer
    Post count: 87

    Hi Guust

    I have spent time to understand my 404 error page problem I explained on the post above :

    First of all I have noticed I’m redirected to the 404 only when the slug of the country is “mysite.com/places/spain” and not when it’s a country with the slug ending with -1 (in that case I’m redirected to mysite.com/fr)

    1/ mysite.com/places/spain :

    I have the 404 problem only because when I’m in the country listing result (English) and I click on the French flag, the address in my browser search bar is : mysite.com/fr/placesspain/ and it should be : mysite.com/fr/places/spain/

    Can I add the missing ” / ” by myself or is it a Geodirectory / WPML bug ?

    2/ mysite.com/places/thailand-1 :

    I have no idea why in that case I’m redirected to the French home page but I don’t really want to figure it out because I would like to get rid of the -1 from my country slugs because it’s too much confusing

    Do you know how can I find the original slug “thailand” and delete it ?
    When I have done it, How can I delete the -1 of the country slug ?

    3/ About the translation that’s my last issue, in the frontend except that problem, everything is working as it should be. But in the backend, in multi location I have tried to translate the countries as explained but in my Geodirectory core Po. file the countries are already translated so I don’t think I have to change it.
    But when I click on “multilocation > Translate countries > update” nothing happen, the French names and slugs are still the same than English

    As everything works well in the frontend is not a big problem for me but for the SEO it would be so much better if I find out how to translate it …

    Thanks again for your precious advices 🙂

    #356292

    Guust
    Moderator
    Post count: 29970

    Your permalinks were not set correctly:
    https://wpgeodirectory.com/docs/basic-installation/#postnames
    FIXED

    To change the “-1” you need to visit the database:
    https://wpgeodirectory.com/docs/faqs/why-do-my-locations-get-a-1-at-the-end/

    We’re fixing a bug that we found too, so we are fixing that. We will let you know when that is done.

    Thanks for your patience.

    #356346

    Kiran
    Moderator
    Post count: 7069

    Hi Clem,

    1) This have been fixed and will be reflected in next release of GD + GD Addons.

    2) This should be fixed from database manually.

    3) Translate countries translates the country slug based on translated country. We have some changes on this and it will be available in next release.

    Please provide FTP & Database details so we can apply patch on your site and also fix 2).

    Thanks,
    Kiran

    #356633

    clem
    Buyer
    Post count: 87
    This reply has been marked as private.
    #356850

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #356854

    clem
    Buyer
    Post count: 87
    This reply has been marked as private.
    #356906

    Kiran
    Moderator
    Post count: 7069

    Hello Clem,

    I have updated patch to your site.
    Please check all the points and let us know if still have any problem.

    Thanks,
    Kiran

Viewing 15 posts - 1 through 15 (of 20 total)

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

Open Support Ticket