Page 1 of 1

permalinks - change & rebuild ?

Posted: Mon Jun 05, 2006 1:47 am
by jdrodrigues
Hi,

If I change the permalinks to just use %id%.html (from %id%-%title%.html), how can I get s9y to rebuild the permalinks to articles ?

Thanks in advance !

- Joel

Re: permalinks - change & rebuild ?

Posted: Mon Jun 05, 2006 1:48 pm
by garvinhicking
Hi!

Usually those permalinks should be automatically rebuilt as soon as you change the permalink in your configuration.

Regards,
Garvin

Posted: Mon Jun 05, 2006 8:48 pm
by jdrodrigues
Hi Garvin,

That's what I thought would happen, but it doesn't in the serendipity_permalinks table, which I suspect is where the lookup takes place.

So, if I change the permalink structure, it does change within the article title links, but it goes nowhere.

Posted: Mon Jun 05, 2006 9:06 pm
by garvinhicking
Hi!

Hm, there's a s9y function "serendipity_buildPermalinks" which should be called when the permalinks are changed. The include/admin/configure.inc.php contains this code:

Code: Select all

            if (serendipity_checkPermission('siteConfiguration') && serialize($permalinkOld) != serialize($permalinkNew)) {
                printf(ATTEMPT_WRITE_FILE, $serendipity['serendipityPath'] . '.htaccess');
                $res = serendipity_installFiles($serendipity['serendipityPath']);
                if (is_array($res)) {
                    echo implode('<br />', $res);
                } else {
                    echo DONE . '<br />';
                }

                serendipity_buildPermalinks();
            }
So it means that when you have the siteConfiguration permission (which you have when you can change the permalinks) it will call this function to truncate the permalinks table and rebuild it.

Which serendipity version are you using?

You could try to switch the URL rewriting to "None" and then back to the value you now have, and change any of the permalink URI structures to try to force the rebuilding?

HTH,
Garvin