Page 1 of 1

Plugin suggestion: smart entry URLs

Posted: Thu Sep 26, 2013 1:15 pm
by yellowled
Let's say I publish my first article in a new blog with the title “First post”. The URL to that article would very likely (unless I fiddle with permalinks or don't use rewriting) be /01-first-post.html in a s9y blog.

Now if I change that entry title to, say, “Open for business”, the entry url will subsequently change in s9y blogs to /01-open-for-business.html, which isn't really cool (cool URLs don't change) and might result in SEO penalties at some point (if one were to do so frequently).

That's pretty easy to solve – if the blog uses mod_rewrite – with a permanent redirect. But it's a tedious task, and new users might not be familiar with editing the .htaccess file. Could we have a plugin which generates these rewrite rules and adds them to the .htaccess automagically on save if the entry title changes? Anybody got some spare time for that?

(I wouldn't be opposed to having that in the core, but I think it's a plugin functionality.)

YL

Re: Plugin suggestion: smart entry URLs

Posted: Thu Sep 26, 2013 1:33 pm
by onli
I was under the impression the core already takes care of that? Though I'm not sure if that is by a rewrite-rule or because only the id is important. Or was that in dsnblog? No, at least in my blog, http://www.onli-blogging.de/1340/Kurze- ... ldung.html and http://www.onli-blogging.de/1340/Kurze- ... dung2.html lead to the same page…

Re: Plugin suggestion: smart entry URLs

Posted: Thu Sep 26, 2013 2:12 pm
by yellowled
onli wrote:I was under the impression the core already takes care of that? Though I'm not sure if that is by a rewrite-rule or because only the id is important.
Erm … okay … confirmed. That works in my test blog as well (didn't think to check that). But there's no redirect for that im my .htaccess. :shock:

Anybody care to explain how that works? Garvin?

YL

Re: Plugin suggestion: smart entry URLs

Posted: Thu Sep 26, 2013 2:26 pm
by onli
I guess I know how that works, I just wasn't sure whether that was because of me mixing this up with my own blog engine. Basically, all we are doing is parsing the entry-id out of the url if s9y detects that this is a pattern of an entry url, and having that entry-id, s9y is able to print the current page. Given ids are unique, that is perfectly fine and covers the case of an user changing the title of an entry.

But: When editing an entry we have to make sure that the id is set in the entry-form, at least when working on 2.0 there were some strange JS-calls for doing that. I hope that was a result of the workover, but an issue on that part could mean that sometimes it won't work, as without the id present a new entry with a new id would be generated. We should make sure there is no such bug when we are done.

Re: Plugin suggestion: smart entry URLs

Posted: Fri Sep 27, 2013 10:04 am
by garvinhicking
Hi!

Yellowled: It works with a rewrite rule and index.php checks for %id% in the permalink. ;)

Other than that if you don't want your permalink to change when changing a blog title, use the custom permalink event plugin to assign your own permalinks.

HTH,
Garvin

Re: Plugin suggestion: smart entry URLs

Posted: Mon Oct 07, 2013 10:32 am
by Fabien
Hi,

What I woul like is to have a field to choose the URL. Default value as it is now and possibility to correct it or to enter a new one.

Cheers, Fabien

Re: Plugin suggestion: smart entry URLs

Posted: Mon Oct 07, 2013 11:03 am
by garvinhicking
Hi Fabien!

Exactly this is offered by the serendipity_event_custom_permalink event plugin!

HTH
Garvin

Re: Plugin suggestion: smart entry URLs

Posted: Mon Oct 07, 2013 11:20 am
by Fabien
Ooops !