Non-English URLs not routing correctly for views

Home Forums Calendar Products Events Calendar PRO Non-English URLs not routing correctly for views

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1000838
    Robert
    Participant

    Hello,

    We had been using the WPML for multi-language support, but recently ditched that effort due to too many incompatibilities between WPML and ECP. So, now we are running a dedicated site as part of our multi-site network to support the Spanish language.

    However, in this configuration the Spanish-language URLs do not seem to be routing correctly.

    For example, the URL:

    http://www.msia.org/es/events/mes/ (“mes” is the Spanish word for “month”)

    gives a 404, whereas the URL:

    http://www.msia.org/es/events/month/

    routes correctly. The problem is that the links generated by ECP itself for the view picker menu in the upper right use “mes” instead of month.

    In order to implement a temporary workaround, we have had to implement the following rewrite rules in Apache:

    RewriteEngine On
    RewriteBase /
    # redirection for Spanish events
    RewriteRule ^es/events/mes(.*)$ /es/events/month$1 [L,R=301,QSA]
    RewriteRule ^es/events/hoy(.*)$ /es/events/today$1 [L,R=301,QSA]
    RewriteRule ^es/events/foto(.*)$ /es/events/photo$1 [L,R=301,QSA]

    However, that’s a pretty crummy hack and we’d love to have a more permanent solution.

    (Note that /es/events/lista works as well as /es/events/list, so it must be just matching l-i-s-t and stopping.)

    Has anyone encountered this kind of thing before? In the Events Calendar (free) plugin translations .po I see that it has entries for e.g. month => mes and today => hoy. However, I’m afraid to delete or alter these in case they’re used as string translations on the page elsewhere. It doesn’t specify a context, so I don’t know if they’re just being used to generate these URLs or used elsewhere.

    Any and all clues greatly appreciated!

    Best,
    Robert

    #1000878
    Robert
    Participant

    After flushing the WP rewrite rules and clearing the front-end cache, it now appears that these endpoints:

    /es/events/fotos
    /es/events/semana

    are working without having to redirect to their English URL equivalents, whereas:

    /es/events/mes
    /es/events/hoy

    still give a 404 if not redirected.

    Very strange–any clues?

    #1000899
    Robert
    Participant

    Digging deeper, it appears the Admin in English plugin was causing a problem. The plugin itself would seem to behave as expected, but I believe some form of “cache poisoning” was going on here.

    We are now trying to determine where the cache poisoning is happening–in an Event Calendar PRO cache for the month, etc.–or in our front-end Varnish caching for WordPress.

    Is it possible that, if we browse Spanish URL endpoints with this plugin active, the Event Calendar Pro will pick up that an admin is browsing and set the wrong language (thus not being able to route the endpoint and giving a 404–in English)? Does ECP operate such a cache? And is it language-sensitive/language-aware?

    Thanks for any pointers.

    Best,
    Robert

    #1001178
    Brian
    Member

    Hi,

    Sorry for the issues I can try to help out here, but I am limited in supporting 3rd party plugins.

    You have a multisite setup correct with a base of:

    MSIA

    And then a Spanish site here:

    Movement of Spiritual Inner Awareness – MSIA

    Do you have coding to automatically redirect based on a language? Or is it just in the Spanish URL with the Admin in English Plugin it was not working?

    Did that plugin only cause issues with someone logged in or did all visitors have any issue?

    And from what I know of the permalinks in ECP it uses the language file selected in the admin settings so with that Admin in English it could be using the English instead of Spanish. Does the Admin in English modify the Admin Bar Language? IF so that could be the cause of this.

    Let me know and I can try to help out.

    Thanks

    #1001331
    Robert
    Participant

    Hi Brian,

    These are good clues, thanks. It’s all users (once an admin with Admin in English activated visits the page), so hence my suspicion of “cache poisoning”. We have the plugin deactivated for now, but I’ll check if Admin in English is modifying the top admin bar as well (I suspect it is!).

    My aim will be to make Admin in English compatible with ECP if possible, since it’s really useful to our admins who don’t speak Spanish. Any pointers there appreciated as well.

    Best,
    Robert

    #1001444
    Brian
    Member

    Ok I see now about the cache poisoning.

    What if you could delay the Admin in English to run later then the Events Calendar?

    This plugin called Plugin Organizer does that.

    Plugin Organizer

    I wonder if the Events Calendar Plugins loaded first it would resolve this.

    Otherwise I looked through our coding and we load the language files on plugin load, which is the recommended way.

    Let me know if that changes anything.

    #1002564
    Robert
    Participant

    Thanks, Brian. That points us in the right direction and we’ll give this a try.

    #1002833
    Brian
    Member

    Sounds Good.

    Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Non-English URLs not routing correctly for views’ is closed to new replies.