# Rewrite rule for permalink TCMS - pretty url

**URL:** <https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308>\
**Category:** RapidWeaver Classic\
**Created:** [November 18, 2024, 3:42pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308 "2024-11-18T15:42:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zdenek](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/zdenek/32/27017_2.png) [@zdenek](https://forums.realmacsoftware.com/u/zdenek)\
**Post date:** [November 18, 2024, 3:42pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308/1 "2024-11-18T15:42:34Z")

</div>

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): [Blog | zeyn](https://www.zeyn.ch/blog/)

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.

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [November 18, 2024, 8:39pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308/2 "2024-11-18T20:39:20Z")

</div>

> [@zdenek](#):
>
> I don’t know if this is linked to some french caracters with accents or to a more extended setting.

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

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

---

<div class="post-metadata">

**Author:** ![zdenek](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/zdenek/32/27017_2.png) [@zdenek](https://forums.realmacsoftware.com/u/zdenek)\
**Post date:** [November 18, 2024, 9:38pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308/3 "2024-11-18T21:38:55Z")

</div>

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](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:

 ![Capture d’écran 2024-11-18 à 18.07.00](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/4/c/4c938fbecd14d132d0c6a050205571de9a65664e.png)  
The TCMS incoming data are inside the cms-data/blog/articles  
 ![Capture d’écran 2024-11-18 à 22.32.45](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/optimized/3X/f/f/ffdbfcfd3a106d42b2c016c331fe50035dbbeb7d_2_690x29.png)

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’écran 2024-11-18 à 22.33.12](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/optimized/3X/2/9/29ebbd994fff09fd960ccbfa2a52a2b950a56186_2_690x29.png)

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

 ![Capture d’écran 2024-11-18 à 22.37.01](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/b/9/b90cde9b0c68c747cf315ed30db44b6e5cc3afe0.png)

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

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [November 18, 2024, 9:56pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308/4 "2024-11-18T21:56:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [November 18, 2024, 9:59pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308/5 "2024-11-18T21:59:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zdenek](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/zdenek/32/27017_2.png) [@zdenek](https://forums.realmacsoftware.com/u/zdenek)\
**Post date:** [November 20, 2024, 2:23pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308/6 "2024-11-20T14:23:38Z")

</div>

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.

 ![Capture d’écran 2024-11-20 à 14.54.47](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/e/1/e1d8d744759b33ff36783bdd341d3c27576ee507.png)

The CommentsStack setting is as follows:

 ![Capture d’écran 2024-11-20 à 14.50.45](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/d/d/dd0782261f89f28f071231c5bda5bef8ae278ea8.jpeg)

 ![Capture d’écran 2024-11-20 à 14.53.02](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/6/7/67fe05b31eb2c1907e66d52491351a903eea278a.png)

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 … 🤔

---

<div class="post-metadata">

**Author:** ![Bruno](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruno/32/25457_2.png) [@Bruno](https://forums.realmacsoftware.com/u/Bruno)\
**Post date:** [November 20, 2024, 5:16pm UTC](https://forums.realmacsoftware.com/t/rewrite-rule-for-permalink-tcms-pretty-url/45308/7 "2024-11-20T17:16:11Z")

</div>

Hi @zdenek You could have a look to [Stacksreview](https://stacksappstacks.com/store/product/00122).
