Home › Forums › Calendar Products › Events Calendar PRO › Non-English URLs not routing correctly for views
- This topic has 7 replies, 2 voices, and was last updated 10 years, 8 months ago by
Brian.
-
AuthorPosts
-
September 1, 2015 at 6:47 am #1000838
Robert
ParticipantHello,
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,
RobertSeptember 1, 2015 at 7:42 am #1000878Robert
ParticipantAfter flushing the WP rewrite rules and clearing the front-end cache, it now appears that these endpoints:
/es/events/fotos
/es/events/semanaare working without having to redirect to their English URL equivalents, whereas:
/es/events/mes
/es/events/hoystill give a 404 if not redirected.
Very strange–any clues?
September 1, 2015 at 8:24 am #1000899Robert
ParticipantDigging 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,
RobertSeptember 2, 2015 at 6:07 am #1001178Brian
MemberHi,
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:
And then a Spanish site here:
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
September 2, 2015 at 10:47 am #1001331Robert
ParticipantHi 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,
RobertSeptember 2, 2015 at 2:05 pm #1001444Brian
MemberOk 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.
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.
September 7, 2015 at 3:20 am #1002564Robert
ParticipantThanks, Brian. That points us in the right direction and we’ll give this a try.
September 8, 2015 at 4:59 am #1002833Brian
MemberSounds 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
-
AuthorPosts
- The topic ‘Non-English URLs not routing correctly for views’ is closed to new replies.
