Line 422:
Line 422:
Permalinks offer the ability to preserve old forum links (from Kunena) and emit a HTTP 301 (Permanent Redirect) when hitting such old links for categories, topics, posts and profile links.
Permalinks offer the ability to preserve old forum links (from Kunena) and emit a HTTP 301 (Permanent Redirect) when hitting such old links for categories, topics, posts and profile links.
−
As of now, such mechanism has not be explored yet but should be taken into account in the migration script and is supported by Discourse software.
+
====Categories permalinks====
−
------
+
Kunena stores aliases for categories in the '''kunena_categories''' '''alias''' database field.
−
Kunena stores aliases for categories in the '''kunena_categories''' '''alias''' database field.
+
====Topics permalinks====
For topics URLs, this a bit more tricky since they are not stored in database (it uses standard Joomla! SEO friendly URLs generated using JRouter) and should therfore be generated on the fly in the import script.
For topics URLs, this a bit more tricky since they are not stored in database (it uses standard Joomla! SEO friendly URLs generated using JRouter) and should therfore be generated on the fly in the import script.
Line 434:
Line 434:
* using <code>transliterate()</code> function in <code>libraries/src/Language/Language.php</code>
* using <code>transliterate()</code> function in <code>libraries/src/Language/Language.php</code>
* using <code>utf8_latin_to_ascii()</code> function in <code>libraries/src/Language/Transliterate.php</code>
* using <code>utf8_latin_to_ascii()</code> function in <code>libraries/src/Language/Transliterate.php</code>
+
+
====Direct messages permalinks====
+
+
Permalinks to specific messages like for example https://www.dolibarr.fr/forum/12-howto--aide/62681-wiki-dolibarr-org?start=225#113400 are even more tricky than topics permalinks because everything that is after a # in considered and anchor and, as such could be treated only on the client side (therefore using Javascript).
+
+
The permalink treatment logic for direct messages is the following :
+
+
# User go to https://test-dolibarr-discourse.traulle.net/forum/12-howto--aide/62681-wiki-dolibarr-org?start=225#113400 (the old permalink)
+
# Normalization permalink rule <code>/(.*)\?.*/\1</code> is triggered and therefore remove part of the URL starting by ? ; the new URL to be processed become https://test-dolibarr-discourse.traulle.net/forum/12-howto--aide/62681-wiki-dolibarr-org#113400
+
# Permalink for topic is triggered and redirect the URL to https://test-dolibarr-discourse.traulle.net/forum/t/wiki-dolibarr-org/27878#113400 (keeping the original anchor with the old postid)
+
# Javascript detect that the current URL have a # part
+
# Using Javascript, we redirect to the permalink https://test-dolibarr-discourse.traulle.net/forum/old-post/113400 that redirects to https://test-dolibarr-discourse.traulle.net/forum/t/wiki-dolibarr-org/27878/227
===Ads===
===Ads===