Rewrite rule for permalink TCMS - pretty url

Hello everyone,
I’m facing an issue with the Blog post permalink. When I create a new blog post, ewerything goes smoothly with no-pretty URL.
After switching the server to pretty URL, things are not going well: firstly, the new article summary (of the blog post) appears correctly in the blog list page. Secondly, when I click on to go to the post (article), I get the article page which must be refreshed to get the author picture. So nothing wrong up to here. However, when I refresh this page, the next one is blank and once it is blank, it remains as it is (it does not happen with no-pretty-url). All the posts from the Blog list are getting a blank page, the url addres is pretty one, but the link with tepost (article) is broken (you can check here - server is still on pretty-url): Le blog de Zdenek Posva

I submitted this issue to Weaver space forum and Joe’s suggestion was that as the permalink uses UTF-8, when rewritten, it might break. I don’t know if this is linked to some french caracters with accents or to a more extended setting. I tried adding to my .htaccess file the following rewrite rule:

RewriteEngine on
RewriteRule ^([^#$%]+)-(\d+).htm$ classified.php?id=$2 [L]

however, as I’m not so frendly with coding, I’m not sure if this might work (I tried to complete my .htaccess file, but without success). My .htaccess pretty url configuration is as follows:

SECTION PRETTY URL RULES FOR TOTAL CMS

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^article/(\S+) /article/article.php?permalink=$1 [L,QSA]

Perhaps someone has already be facing a similar issue ?
If so, thank for your help.

that is the reason! you cant use french caracters with accents in the slug-url.
this is the same thing with ü ö ä in German :wink:

you can use the special characters in the title but then you have to adjust them in the permalink URL

1 Like

OK for the accents, but when I create a very simple blog post, “test” vith the permalink “test” and 2 words in summary and content field (i.e. no accent at all), the result is the same: The post appears (after the first click on the summary in the blog list page) with url https://www.zeyn.ch/article/test.
Then, as usual, I need to refresh the page in order to let appear the author logo. After that, the post disappears and remains blank for any following click.
So from this perspective, the accents does not seem to be the reason of this issue.

Perhaps some details of my Blog directory structure will give more idea:


The TCMS incoming data are inside the cms-data/blog/articles
Capture d’écran 2024-11-18 à 22.32.45

As per the rewrite rule in .htaccess (RewriteRule ^article/(\S+) /article/article.php?permalink=$1 ), the addresses are rewritten into the article (first in the above picture) folder (with 0 kB content):
Capture d’écran 2024-11-18 à 22.33.12

And the url post page in the browser: https://www.zeyn.ch/article/test is blank, with (almost) empty head section:

So I’m really at the end of my thoughts … :wink:

this is your blog url: www.zeyn.ch/blog/
here you can see your test entry …

it looks like your tcms setup is totally mixed up … it can’t work that way.

send me your projekt file (zip) via message and i can fixed that

Finally, I got the origine of this issue: The CommentsStack added at the end of the BlogPost stack. After deletting this one, the pretty-url works fine. I thing the mix between F6, TCMS and 3rd part stacks makes a trouble (or I would need another comments settings for pretty-url - see bellow). Actually the CommentsStack requests refreshing of the blog post page, after which the page is blank.

The CommentsStack setting is as follows:

Even if this is not mandatory, I would like to have comments for each blog post, so if you have any further idea how to do it, I’m open … :thinking:

1 Like

Hi @zdenek You could have a look to Stacksreview.