Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-09-13 08:10:53
- einbecker
- New Member
- Registered: 2006-09-13
- Posts: 2
custom url scheme
Hey there!
I am converting a group weblog from wordpress to textpattern, and want to keep all URLs the same. The problem is: We use a custom format: “/year/topic”, meaning we have something like /2006/about-us as a result. Is there any way of doing this? I searched all over the forums and the net, but could not find any answer to this particular problem.
Thanks for your help & the great software you have built!
Cheers!
Offline
Re: custom url scheme
There is no built-in feature that allows fully custom urls, because we feel that for a majority of users this is more trouble than worth it. The available selection of url-schemes fits most people needs.
If you want to stick with your url-scheme, I think it’ll be tricky to do this as a plugin (are you comfortable with PHP or have someone who is?). And I always recommend against modifying source-code as that will make updating to newer versions harder.
If I was you I would probably look into migrating to one of the available schemes. If you decide for /section/title or just /title redirecting the urls with mod_rewrite (or by creating a txp-plugin for that purpose) would be pretty easy. If you are concerned about url-title-clashed, you could adapt the import-script to prepend the year in the url-title, like this “/2006-about-us” for older articles.
Offline
#3 2006-09-13 10:30:08
- einbecker
- New Member
- Registered: 2006-09-13
- Posts: 2
Re: custom url scheme
Thanks a lot for the answer… I will look into writing a plugin, my skills in PHP are not that great, but hey, why do I study computer science? ;-)
Offline
Re: custom url scheme
einbecker,
I’ve been wondering the same thing as of late. I have a Nucleus site that I plan on migrating over to Textpattern in the near future. The scheme it uses is /item/714 for the article number, which has no correlation to any Textpattern URL scheme.
There’s no way to do it via mod_rewrite, at least none that I’ve seen, I’d probably need a plugin that would look up /item/714 and spit out /journal/714/xmas-week. This site is over 2 years old and it has over 2000 articles, it gets it’s share of traffic and I’d hate to start serving up 404’s.
I’d be interested to see what you come up with.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
#5 2006-09-14 02:16:46
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: custom url scheme
You can leave the url-title off Textpattern URLs. /journal/714 is the same as /journal/714/xmas-week.
Alex
Offline
Re: custom url scheme
zem wrote:
You can leave the url-title off Textpattern URLs. /journal/714 is the same as /journal/714/xmas-week.
Damn, just tried it and it worked, maybe I’ll be able to convert over sooner than I thought.
Thanks.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Pages: 1