permalinks - change & rebuild ?

Having trouble installing serendipity?
Post Reply
jdrodrigues
Regular
Posts: 36
Joined: Sun Feb 12, 2006 9:27 pm
Location: London
Contact:

permalinks - change & rebuild ?

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: permalinks - change & rebuild ?

Post by garvinhicking »

Hi!

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jdrodrigues
Regular
Posts: 36
Joined: Sun Feb 12, 2006 9:27 pm
Location: London
Contact:

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply