Okay. I'll tell you the modifications for Serendipity 0.8. They basically also apply to 0.7, but in 0.7 you will find the files in different directories.
1. Open your include/tpl/htaccess_rewrite.tpl file
2. Modify those patterns:
Code: Select all
RewriteRule ^{PAT_ARCHIVES} {indexFile}?url=/{PATH_ARCHIVES}/$1.html [L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html {indexFile}?url=$1-article.html [L,NC,QSA]
to this:
Code: Select all
RewriteRule ^{PAT_ARCHIVES} {indexFile}?url=/{PATH_ARCHIVES}/$1 [L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*{indexFile}?url=$1-article [L,NC,QSA]
2. Open your serendipity_config.inc.php file. Change those constants:
Code: Select all
@define('PERM_ARCHIVES', '%id%-%title%.html');
@define('PAT_ARCHIVES', '@/'.PATH_ARCHIVES.'([/A-Za-z0-9]+)\.html@');
@define('PAT_COMMENTSUB', '@/([0-9]+)[_\-][' . PAT_FILENAME . ']*\.html@i');
into this:
Code: Select all
@define('PERM_ARCHIVES', '%id%-%title%');
@define('PAT_ARCHIVES', '@/'.PATH_ARCHIVES.'([/A-Za-z0-9]+)@');
@define('PAT_COMMENTSUB', '@/([0-9]+)[_\-][' . PAT_FILENAME . ']*@i');
If you're using 0.7 you will also need to open serendipity_functions.inc.php and change function serendipity_archiveURL() into:
Code: Select all
function serendipity_archiveURL($id, $title, $key = 'baseURL', $checkrewrite = true) {
global $serendipity;
return $serendipity[$key] . ($checkrewrite && $serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . PATH_ARCHIVES . '/' . (int)$id . '-' . serendipity_makeFilename($title);
}
3. Then go to Serendipity configuration, set your URL Rewriting to None, Save, set it to 'mod_rewrite' and save again. This will recreate your .htaccess with your new htaccess_rewrite.tpl settings.
Then it should work. Note that however searchengines like google will now score your URLs lower, because at the moment .html files have higher precedence than a path name.
Regards,
Garvin