Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Current version:
0.1.8.4
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

sgb_url_handler

I’ve posted elsewhere about making modifications to TxP in order to support all URL formats at the same time. Rather than make the modifications directly to TxP I rolled them into a plugin.

This plugin was designed and tested with TxP 1.0 RC3 (updated from subversion on 2005-03-05).

Now for some background. I love the fact Dean & Co. add so many URL options to TxP. However only supporting one type of incoming link at a time seems like an oversight to me. While links on your own site might not break when you change modes, links off-site (such as links posted in forums or wikis) will. This plugin allows you to change your URL mode at will while still supporting any/all URL formats.

Currently it supports the following formats:
example.com/section/id/title
example.com/section/title
example.com/section/category/title
example.com/section/category
example.com/section
example.com/title
example.com/id/title
example.com/year/month/day/title (although this appears to be broken in RC3)

Additionally, this plugin supports the following trigger words:
example.com/{section}/Section
example.com/{category}/Category
example.com/{author}/Author
example.com/atom
example.com/rss

The plugin supports all these modes with or without a trailing slash. In the event of collisions, the plugin will check the more general term first, e.g. /Section will be checked before /Title.

Also note that this plugin is designed to work with clean URLs on servers without mod_rewrite. You’ll need to modify your links and append index.php/ to the beginning, e.g. example.com/index.php/section/id/title is the same as example.com/section/id/title.

The plugin “pipes” /Section, /Category and /Author requests to the corresponding $_GET, $_POST super globals so they are handled normally by TxP.

If the plugin can’t figure something out it just returns and let’s TxP handle it normally.

I’ve written instructions for adding permlink modes for /Section/Title and /Section/Category/Title. These instructions can be found here.

Article Request Count:
Initially released:
2004-03-23
Posted here:
14 Mar 2005

You know you want to visit the Archives.
Published with Textpattern