• I fixed the issue by installing the old version of the plugin. I spent unexpectedly 3 hours to figure out what has happened. It was very frustrating on an important website.

    The problem was that the new version of the plugin caused redirection loop on category pages with cyrillic URL showing posts but not on a single post or page.

    It something that you should fix as soon as possible

Viewing 11 replies - 1 through 11 (of 11 total)
  • Exactly the same problem with my web (ekodotace.brno.cz/aktuality/) after updating to version 3.2.2. Everything else (pages, posts, archives) works except category pages – they show too many redirects error in all language versions. After deactivating Polylang the problem disappears. Plaese fix it asap. Thank you.

    Thread Starter Kristijan

    (@kristijanct)

    Yes, it can cause problems even on non-cyrillic websites. I had issues on multiple WordPress websites that use Polylang, I noticed later. In one case made a conflict with .htaccess http to https redirect. Please notify when you solve the problem. And sorry for my English, I make mistakes when in hurry.

    Plugin Support Chrystl

    (@chrystl)

    Hello @kristijanct,

    To investigate your issue I would need that you gave me an example of the url having your issue. In your url, have you the category base in english or in cyrillic as in the example below:?

    mysite.com/ru/category/привет

    or

    mysite.com/ru/категория/привет

    Could you please let me know if you have modified the WordPress category base by adding a new one in cyrillic in Permalinks > Optional > Category base? Could you please show me thanks to a screenshot your Permalinks settings?

    Hello @gorg01,

    The problem that you get seems to be different from the one mentioned by @kristijanct. In fact you are removing the category base of WordPress. If you attempt to do it without a dedicated plugin, expect plenty of issues. It exist 2 plugins allowing to remove cleanly the category base: the plugin “No category base” (the original plugin for this feature: https://wordpress.org/plugins/no-category-base-wpml/) and Yoast SEO which basically copied the previously cited plugin and we have included a compatibility works with these 2 plugins.

    Hello, thanks for your response. Well, the web existed flawlessly for more than 2 years, this category issue started 2 days ago. There was no need to install additional plugins in order to remove category base untill now. So installing them is not the solution unless there is no other way. I have no Yoast SEO installed, I deactivated all plugins, only temporarilly deactivating Polylang did the trick. So please, investigate it.

    • This reply was modified 2 years, 1 month ago by gorg01.
    Thread Starter Kristijan

    (@kristijanct)

    Hello,

    First of all thanks for replying promptly. The issue is definitively caused by the Polylang update. I didn’t want to get into why exactly because I have unexpectedly already spent several hours in debugging the issue in order to get functioning the website. The mentioned website, with the cyrillic categories and cyrillic slugs, was functioning well in that format since September 2021 and I noticed the problem by browsing, after I posted a new article today.

    I have already tried various things to resolve it, I have a custom theme (made by me) on that website so I started debugging the theme first. Then I tried ALL the possible options in WordPress itself, by making changes in Permalink settings firstly. Looked in Categories, then again in the functions.php, and then in menus, in categories theme files, in Polylang settings and then again in Permalink settings, .htaccess file etc.

    I will let you know what are my current settings but be sure that I’m not a novice, that I have tried everything and that I’m pretty sure that I’m not wrong.

    My main lang categories are: Ћирилица (slug: ћирилица), Latinica (slug: latinica) and English (slug: english), all set to proper language and all with sub categories.

    Permalink Settings:

    Custom Structure: https://www.mywebsite.org.me/%category%/%post_id%-%postname%/

    Category base: (currently blank but functioned well with a dot “.” until the update)

    Tag base: hashtag

    Regarding the “Category base”, currently, due to debugging, I have the bellow code that is functioning well in function.php witch removes the “category” in the URL:

    function remove_category( $string, $type ) {
    	if ( $type != 'single' && $type == 'category' && ( strpos( $string, 'category' ) !== false ) ) {
    		$url_without_category = str_replace( "/category/", "/", $string );
    		return trailingslashit( $url_without_category );
    	}
    	return $string;  }
    add_filter( 'user_trailingslashit', 'remove_category', 100, 2);

    BUT regardless this code (without it), every other setting (including the current) in the Permalink Settings will create the infinite redirection loop with the newer version of the plugin on https://www.mywebsite.org.me/ћирилица, while https://www.mywebsite.org.me/latinica and https://www.mywebsite.org.me/english will function well.

    As a desperate move I have downloaded the old version of WordPress and a version 3.14 of Polylang,, since everything was working well before, and tried first to downgrade Polylang, and it functioned. Now everything works well. As it was since September 2021.

    Also, I had a sudden problem on other websites with this redirection in .htaccess which worked fine before:

    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

    I’m not sure that is a coincidence but I don’t know.

    Plugin Support Chrystl

    (@chrystl)

    Hello @kristijanct,

    Thank you for all these informations. Could you please show me your Permalinks page as requested and give me a link to your site to check your url structure?

    Thread Starter Kristijan

    (@kristijanct)

    I have already writed all the settings I have on that page, since I don’t see here the attach button you will have to wait until I log in on my computer, to upload the screenshot. Thank you for trusting me just on my word 🙂 One of the addresses that were affected (a category) is https://www.cpc.org.me/%d1%9b%d0%b8%d1%80%d0%b8%d0%bb%d0%b8%d1%86%d0%b0/%d0%bd%d0%be%d0%b2%d0%be%d1%81%d1%82%d0%b8/.

    Thread Starter Kristijan

    (@kristijanct)

    I uploadeded the screenshot by phone, to save some time, here you are:

    https://www.cpc.org.me/wp-content/uploads/2022/04/Screenshot_20220429_094309_org.mozilla.firefox-scaled.jpg

    Thread Starter Kristijan

    (@kristijanct)

    Plugin Support Chrystl

    (@chrystl)

    Hello @kristijanct
    Thank you for all these informations. The issue comes from the category base that you are removing thanks to the code that you pointed. Removing the category base is a very such complex mechanism. In my knwoledge there are 2 plugins doing this action cleanly: “No category base”: https://wordpress.org/plugins/no-category-base-wpml/) and Yoast SEO (which basically copied the previously cited plugin). When the category base is removed is that a set of rewriting rules per term must be coded. This is what these 2 plugins did for WordPress base category. To make their actions (remove category base) works in a multilingual context we have written a compatibility for these 2 plugins. When we evolve our code (this is the case for the 3.2.2) we are careful to maintain compatibility with these 2 plugins. So if your custom code to remove the category base doesn’t work anymore with the 3.2.2 version the solution is to use one of the 2 mentioned plugins.

    Thread Starter Kristijan

    (@kristijanct)

    Look, I appreciate the fact that you give this free version of the plugin for all users. Also it is fair to test new code on the free version and I accept that. I only wanted to help you to improve your code because I think that the things should work that way and I already find the solution by downgrading the version.

    Said that, from the beginning you didn’t read carefully what I have written and that is not quite OK from you since I invested some time and effort for a “greater good”, both for users and for developers.

    Instead of fully investigate why ONLY on the cyrillic category slugs the updated plugin caused infinite redirection loop, you are firstly asking me the same data that I already provided by requiring the screenshot, which tells me that you either did not read carefully what I said or you did not trusted me.

    Secondly, your last answer also suggest me that you read superficially what I have write. Dear @chrystl, if you read carefully above, you will notice that I have spent 3 hours in debugging the issue. You will find that when the problem emerged I have not initially had the code which removes the “category” slug but instead I had a dot “.” in “Category base” in “Permalink Settings”, so the code is not something that made this problem. You only used the fact that I posted it to give some kind of answer in a manner: we are working something, whatever it is.

    The primary way, without a plugin nor extra code. to get rid of the category base is to put a dot “.” in the optional “Category base” field and set the custom structure “Custom Structure” to “/%category%/%post_id%-%postname%/”, if you know what I’m talking about.

    If I understood you correctly, you are promoting the two plugins you mentioned to do something that can be done natively in WordPress as I described above, and at the same time you are discouraging users to use this simpler way by deliberately not taking it in account?

    I know that you will give now a similar superficial, “bot-like”, answer as you did every time so I give up. You won. If it is a win. I did what could. I warn you and the community about the problem.

    By doing that I tried to help both you, to make a better code, and the community, by giving the solution and to not waste, like I did, hours in vain.

    Best regards and good luck for future updates.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Infinite redirect loop with cyrillic characters in category URL’ is closed to new replies.