Joomla 4. Компонент K2 и форк K2ForJ4 (18 янв 2024)

Если вас, как и меня, достало выслушивать (вычитывать) бесконечные обещания разработчика K2 опубликовать версию компонента K2 под Joomla 4 (без чего невозможно реализовать апгрейд from Joomla 3 to Joomla 4) - воспользуйтесь форком K2ForJ4. Который в данный момент установлен и без каких-либо проблем работает на этом веб-сайте.

Upgrade Joomla from J1.5 to J3. Htaccess

Больше
10 года 3 нед. назад - 10 года 3 нед. назад #1 от Aleksej
Aleksej создал тему: Upgrade Joomla from J1.5 to J3. Htaccess
Понадобилось тут припомнить объяснения Матиаса, разработчика kunena… полученные от него несколько лет назад, когда впервые пришлось столкнуться с проблемой неработоспособных, после обновления Joomla v.1.5 к Joomla v.2.5, ссылок kunena. Прозвучали они так:

Joomla 1.7 uses your local transliteration method where Joomla 1.5 just removed everything which wasn't in ASCII. I was fearing that something like this would happen if you don't use category ids in the urls.

Currently there's no good way implemented to work around this issue -- it isn't directly related to Kunena (we cannot fix something that we didn't know about), but there is one thing you can do:

You can add redirects to your .htaccess file!

You only need to add redirects for categories, which limits number of rules into something that can be managed. So If you have:

Code:
masterpro.ws/forum/38-web---/3359-gap--- masterpro.ws/forum1/38-web-sajt-svoimi-r...atsiya-svoimi-rukami .. Mapping is: 38-web--- => 38-web-sajt-svoimi-rukami

BTW: In your case you haven't removed category IDs from your Kunena configuration, so this URL should keep on working, even if it has changed. Kunena 1.7 also uses canonical URLs, which means that these old URLs will be converted to new ones when Google goes through your site.

So this category mapping is really only issue IF you have changed your Kunena configuration not to use category IDs in your URLs. Am I right?



Yes, right. Да, так вот относительно редиректа... Возможно, данная информация кое-кому и пригодится; в контексте схожего с описанным случая, когда положение дел осложнялось еще и кириллицей, проблему удалось вылечить следующим образом; как и рекомендовано Матиасом - You can add redirects to your .htaccess file, это выглядит примерно так (привожу git log, а также сравнение с дефолтным для joomla htaccess):

Code:
$ git log -p commit b280707ba0edf4caa151a0d747e78719e71ced24 Author: Pavel Alexeev (aka Pahan-Hubbitus) <pahan@hubbitus.info> Date: Mon Mar 24 22:54:58 2014 +0400 Add mod_rewrite rule to handle old forum links diff --git a/.htaccess b/.htaccess index f2a757b..5d6f873 100644 --- a/.htaccess +++ b/.htaccess @@ -45,6 +45,12 @@ RewriteRule .* index.php [F] # www redirect (or vice versa), place that code here. Ensure those # redirects use the correct RewriteRule syntax and the [R=301,L] flags. # +RewriteCond %{REQUEST_URI} !^/index\.php +RewriteCond %{REQUEST_URI} ^/component/kunena/$ [NC] +RewriteCond %{QUERY_STRING} ^func=view&(.+)$ [NC] +# Debug for see in header answer +#RewriteRule (.*) http://tttt/!!!$1!!!REQUEST_URI:%{REQUEST_URI}!!!QUERY_STRING:%{QUERY_STRING}!!!THE_REQUEST:%{THE_REQUEST}!!!1:%1 [NE,L] +RewriteRule (.*) http://%{HTTP_HOST}/forum?view=topic&%1 [NE,R=301,L] ## End - Custom redirects ##

Code:
[aleksej@localhost 2014]$ diff htaccess_old htaccess_new 2,4c2,4 < # @package Joomla < # @copyright Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved. < # @license GNU General Public License version 2 or later; see LICENSE.txt --- > # @package Joomla > # @copyright Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. > # @license GNU General Public License version 2 or later; see LICENSE.txt 47a48,53 > RewriteCond %{REQUEST_URI} !^/index\.php > RewriteCond %{REQUEST_URI} ^/component/kunena/$ [NC] > RewriteCond %{QUERY_STRING} ^func=view&(.+)$ [NC] > # Debug for see in header answer > #RewriteRule (.*) http://tttt/!!!$1!!!REQUEST_URI:%{REQUEST_URI}!!!QUERY_STRING:%{QUERY_STRING}!!!THE_REQUEST:%{THE_REQUEST}!!!1:%1 [NE,L] > RewriteRule (.*) http://%{HTTP_HOST}/forum?view=topic&%1 [NE,R=301,L] 77d82 < php_flag register_globals off

Enjoy!
Последнее редактирование: 10 года 3 нед. назад пользователем Aleksej.

Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.

Dev banner 3
Работает на Kunena форум