Permalinks not regenrated as mentioned in configuration.inc.

Having trouble installing serendipity?
User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Permalinks not regenrated as mentioned in configuration.inc.

Post by seraphyn » Mon Oct 15, 2012 9:54 am

Hi,

I tried to change the permalinks of the articles ( archives/%id%-%title%.html) to (archives/%title%.html) and hopefully hoped that they will be regenerated.
Have had a look in include/admin/configuration.inc.php

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();
            }
but nothing changed.
Found a blogpost mentioned that http://board.s9y.org/viewtopic.php?p=30297
Does someone is having a hint?

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by garvinhicking » Mon Oct 15, 2012 9:59 am

Hi!

Yeah, when changing these, you should get new permalinks everywhere. What's your blog's URL, show us where those permalinks do not show up?

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/

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Mon Oct 15, 2012 10:29 am

I switched back from jekyll to S9Y
and at the moment it is http://s.teiko.org
so I would like to use the same structure as bevor without ids.

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Mon Oct 15, 2012 11:11 am

Regenrated a new .htaccess and then tried to change the archives-URL.
Same behaviour.
Answere is

Keine Einträge vorhanden
Pagination
Seite 1 von 1, insgesamt 0 Einträge

New one is http://s.teiko.org/archives/RASBMC-XBox ... cking.html
Norm URL is http://s.teiko.org/archives/999-RASBMC- ... cking.html
After change the PermURL back to archives/%id%-%title%.html anything wents fine

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by garvinhicking » Mon Oct 15, 2012 11:16 am

Hi!

Maybe I'm not understanding right.

When s9y's permalink structure is changed, all links that s9y created will use that permalink scheme. Then s9y also writes those rewrite rules to the .htaccess, so that links can be created.

What it DOES NOT DO is to CONVERT old permalinks to new ones. If you change from /archives/%title% to /archives/%id%-%title% then ALL links that have /archives/%title% will no longer work, s9y does NOT redirect them automatically. You have do that on your own, because it would be too much overhead for s9y. It's your responsibility when changing URLs to think about the effects it will have on older links; s9y will only take care that it will create all links with the configured permalink.

So in your case, you should configure the format you want to have in the end, automatically. And then you must write your own custom rewriterule to convert old style links to new ones; like the rule I posted on another thread to you. You need to make sure that these rules come before the ones that s9y automatically creates.


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/

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Mon Oct 15, 2012 11:21 am

Okay, I thought the old ones would be converted too.
So that's my fault, I cheered too soon.
I tired the rewrite rule and it had no affect.
With RewriteRule archives/[0-9]+\-(.+) /archives/$1 [L,QSA,R=302] I allready have the ID in it :(
Chris

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by garvinhicking » Mon Oct 15, 2012 1:56 pm

Hi!

Please post your full .htaccess and your URL (I get a 403 on http://s.teiko.org/)?

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/

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Mon Oct 15, 2012 2:00 pm

garvinhicking wrote:Hi!

Please post your full .htaccess and your URL (I get a 403 on http://s.teiko.org/)?

Regards,
Garvin
Sorry,, tried something, should work now with http://s.teiko.org
my .htaccess:

Code: Select all

# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php
php_value session.use_trans_sid 0
php_value register_globals off
Options -MultiViews

RewriteEngine On
RewriteBase /
RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA]
RewriteRule ^((archives/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+\.html)/?) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archive([/A-Za-z0-9]+)\.html index.php?url=/archive/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)?$ index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^comments/(.*) index.php?url=/comments/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
#RewriteCond %{REQUEST_URI} !-U
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

<Files *.tpl.php>
    deny from all
</Files>

<Files *.tpl>
    deny from all
</Files>

<Files *.sql>
    deny from all
</Files>

<Files *.inc.php>
    deny from all
</Files>

<Files *.db>
    deny from all
</Files>

# END s9y

<FilesMatch “\.(js|css|html|htm|php|xml|json|eot|woff|jpg|JPG|PNG|png)$”>
 SetOutputFilter DEFLATE
 AddOutputFilterByType DEFLATE text/html text/plain text/xml
 </FilesMatch>

#1woche
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|JPG|woff|eot)$">
Header set Cache-Control "max-age=2678400, public"
</FilesMatch>

#1woche
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>

# NEVER CACHE
<FilesMatch "\.(html|htm|php|cgi|pl)$">
Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
</FilesMatch>

#RewriteBase   /archives
#RewriteRule ^archives/([0-9]*-)(.*)$ archives/$2  [PT,L] 
#RewriteRule ^archives/([0-9]*-)(.*)$ archives/$2  [R=301,L]
#RewriteRule /([0-9]*-)(.*)$ $2  [R=301,L]


<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType text/css "access plus 1 week"
 ExpiresByType application/javascript "access plus 1 month"
 ExpiresByType application/x-javascript "access plus 1 month"
 ExpiresByType image/gif "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 month"
 ExpiresByType image/png "access plus 1 month"
 ExpiresByType image/x-icon "access plus 1 year"
 </IfModule>

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by garvinhicking » Mon Oct 15, 2012 3:16 pm

Hi!

Just so that I understand; you want the URL to NOT contain the number, right?

Currently it seems your s9y is configured to contain the %id% string for archives, because the generated URLs look like that. Can you make a screenshot of your permalink configuration to show how your config currently looks like?

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/

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Mon Oct 15, 2012 3:31 pm

ATM it is the normal version.
Permalink-Struktur für die Artikel-URLs
Legt die relative URL-Struktur fest (beginnend mit der Stamm-URL), mit der normale Artikel dargestellt werden. Die Variablen %id%, %title%, %day%, %month%, %year% und alle anderen normalen Zeichen sind möglich.
archives/%id%-%title%.html

and now I switch to
archives/%title%.html

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Mon Oct 15, 2012 3:33 pm

btw this time it could not write .htaccess and I should paste this one in:

Code: Select all

# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php
php_value session.use_trans_sid 0
php_value register_globals off
Options -MultiViews

RewriteEngine On
RewriteBase /
RewriteRule ^serendipity_admin.php serendipity_admin.php [NC,L,QSA]
RewriteRule ^((archives/[0-9a-z\.\_!;,\+\-\%]+\.html)/?) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)\-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)\-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archive([/A-Za-z0-9]+)\.html index.php?url=/archive/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)?$ index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^comments/(.*) index.php?url=/comments/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
#RewriteCond %{REQUEST_URI} !-U
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

<Files *.tpl.php>
    deny from all
</Files>

<Files *.tpl>
    deny from all
</Files>

<Files *.sql>
    deny from all
</Files>

<Files *.inc.php>
    deny from all
</Files>

<Files *.db>
    deny from all
</Files>

# END s9y
But nothing changed, it doesn't work. Links in the Title or right, but no page is available for that

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by garvinhicking » Tue Oct 16, 2012 9:37 am

Hi!

Hm, that is really weird. The generation works, but s9y does not properly pick up the links and convert them.

Can you check your serendipity_permalinks database table? This should hold a list of all existing permalinks, and they should be in the new format (without ID)?

Sorry for the hassle :( But I'm sure we can fix this!

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/

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Tue Oct 16, 2012 10:22 am

garvinhicking wrote:Can you check your serendipity_permalinks database table? This should hold a list of all existing permalinks, and they should be in the new format (without ID)?
LOL, do you believe when I'm tellin you that there's no table in the DBMS called like that?
I ment, that was the first instance I've had a look and thought by myself
Man, you're piece of a dumb #§$", there's another place where this data is being hold, ask in the forum, because it isn't written in the book, too

See the Screenshot ;)
Image

And MySQL gimme zero results in
SELECT *
FROM `serendipity_links`
LIMIT 0 , 30

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by garvinhicking » Tue Oct 16, 2012 12:21 pm

Hi!

Huh, that's odd. Did you use a very old installation and upgrade it to a recent s9y?

Please check the sql/db.sql file of your install and compare it to the list of tables you have. You are missing the "suppres" and "permalinks"

You should be fine if you execute this in your phpmyadmin:

Code: Select all

CREATE TABLE serendipity_suppress ( 
  ip varchar(64) default NULL,
  scheme varchar(5),  
  host varchar(128),
  port varchar(5),
  path varchar(255),
  query varchar(255),
  last timestamp NOT NULL
)

CREATE INDEX url_idx on serendipity_suppress (host, ip);
CREATE INDEX urllast_idx on serendipity_suppress (last);

CREATE TABLE serendipity_permalinks (
    permalink varchar(255) not null default '',
    entry_id int(10) not null default '0',
    type varchar(200) not null default '',
    data text
)

CREATE INDEX pl_idx ON serendipity_permalinks (permalink);
CREATE INDEX ple_idx ON serendipity_permalinks (entry_id);
CREATE INDEX plt_idx ON serendipity_permalinks (type);
CREATE INDEX plcomb_idx ON serendipity_permalinks (permalink, type);
After that, change your permalinks to %id%-%title%, save, and then change it back to %title% again. This should populate the serendipity_permalinks table!

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/

User avatar
seraphyn
Regular
Posts: 211
Joined: Fri Dec 01, 2006 8:42 am
Contact:

Re: Permalinks not regenrated as mentioned in configuration.

Post by seraphyn » Tue Oct 16, 2012 12:27 pm

Got an Error:
CREATE TABLE serendipity_suppress(
ip varchar( 64 ) default NULL ,
scheme varchar( 5 ) ,
host varchar( 128 ) ,
port varchar( 5 ) ,
path varchar( 255 ) ,
query varchar( 255 ) ,
last timestamp NOT NULL
) CREATE INDEX url_idx ON serendipity_suppress(
host,
ip
);



MySQL meldet:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE INDEX url_idx on serendipity_suppress (host, ip)' at line 11

Yes, used an old one, set it up, delted the db in the dbms, import the old one, rewrite the version to the old version, let the update roll, regenerate .htacces, import octopress articles via RSS, renew articles and now I'm here.

Post Reply