Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-04 08:56:03

Hiram
Member
From: Utrecht, Netherlands
Registered: 2004-02-16
Posts: 35
Website

... switch permanent URL mode without breaking old links?

I want to switch the permanent URL mode (as defined in admin > preferences) from /section/id/title to /year/month/day/title (or, if that’s not possible, simply /id/title).

Is there a way to do this without breaking existing links (that use the /section/id/title scheme)? I suspect this would take some editing of the .htaccess file, but I wouldn’t know how, exactly. I’m running 4.0.1 on a Textdrive server.

If this has been answered on the forum before, I couldn’t locate the thread. Thanks in advance for any input.

Last edited by Hiram (2005-10-04 08:58:29)

Offline

#2 2005-10-04 09:48:59

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: ... switch permanent URL mode without breaking old links?

AFAIK you need to set in .htaccess a permanent redirect status (301) directive, like the following:

Redirect permanent /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html

I guess some .htaccess guru should be able to create a reg exp out of this.

Last edited by Neko (2005-10-04 09:51:31)

Offline

#3 2005-10-04 10:57:32

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: ... switch permanent URL mode without breaking old links?

One of the sgb plugins lets you specify a preferred URL format and will coerce incoming links to them with HTTP redirects, I think.

Neko: doing it in .htaccess would require writing a rule for each and every article; there’s no way to write a regex that’d query the db for the correct date elements.


You cooin’ with my bird?

Offline

#4 2005-10-04 12:00:35

Neko
Member
Registered: 2004-03-18
Posts: 458

Re: ... switch permanent URL mode without breaking old links?

> ubernostrum wrote:

Neko: doing it in .htaccess would require writing a rule for each and every article; there’s no way to write a regex that’d query the db for the correct date elements.

Oh, OK, sorry :) I usually have too high hopes into nerds abilities.

Offline

Board footer

Powered by FluxBB