Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Zero –
Let me know if you still have problems, but the recent (0.1.5) release should fix it.
Edit: It’s a Monday, make sure you re-download 0.1.5 even if you grabbed it earlier today. There was a bone-headed mistake. Sorry!
- sgb
Last edited by sungodbiff (2005-03-14 22:08:08)
Offline
#32 2005-03-15 16:14:14
- rob_roy
- Archived Plugin Author
- Registered: 2005-02-28
- Posts: 18
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
SGB,
Is there a reason the sgb_error_documents doesn’t (or can’t) send the appropriate header for cases of url redirect? If I use ID, the error document ends up going to my default template, so I get things like article navigation and other gubbins I’ve stuck on the default template. I much prefer the scenaria of redirecting to \error\$code since I have better control over the page layout. In that case, however, I prefer to make sure the client knows it’s gotten an error, as well as the person reading the client, y’know?
Can it be as simple as adding <code>header($headers[$code]);</code> to the redirect section?
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
rob_roy -
Glad you asked. To be honest I wasn’t sure what was proper in that situation (does any one know?). I didn’t want to mess up the redirect by sending a different status code, plus I figured users could always have the error page send the status code. That way the browser would get the correct error while actually seeing the corresponding error message.
It’s pretty simple to change (as you already noted in your post) though and I can certainly modify it to send the error code before the redirect. Alternatively you could also use the file property and get the same effect with out having to redirect.
Hope this helps!
- sgb
Last edited by sungodbiff (2005-03-15 16:46:19)
Offline
#34 2005-03-18 05:20:16
- Anark
- Member

- Registered: 2004-08-14
- Posts: 101
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Not to rain on anyone’s parade, but this plugin makes me uneasy: “mirrors” and suchlike aside, the internet has so far been doing quite well using the principle that one URL corresponds to one document and vice versa. You’re effectively saying that this principle should no longer apply, and that any document, at the webmaster’s whim, should have eight (sixteen, thirty-two, where to stop?) different URLs. True, this may relieve the webmaster of the necessity to plan ahead, pick an URL scheme and then jolly well stick to it, but look at it from the user’s perspective and you’ll realise you’ve got a usability issue on your hands.
To pick an obvious example, think of Google trying to calculate the pagerank of any one of your documents: let’s say your document has 200 inpointing links. These inpointing links, however, reference all eight URLs of that document. For Google to weigh these links adequately, it will first have to find out that it’s dealing with one document rather than eight.
It’ll take a while until the folks at Google will respond to the reality that documents on the Internet now have any number of different URLs. They will grumble a bit about it, but then they will begin to compare pages and come up with whatever computation is necessary to stop these eight URLs counting as eight documents.
Until that happens, search users will have to deal with the annoyance of the same document showing up as eight different documents.
This is just off the top of my head — I’m sure you could think up quite a number of negative effects that multiple URLs have.
Call me old-fashioned but as a Web user I like the idea that in most cases one document will correspond to one URL, and that a placeholder or a server-side redirect should point to a new URL if the old one changes (which, in an ideal world, it wouldn’t anyway). You propose to get around this and go easier on the webmaster, but you end up making things harder for everyone else.
I found this thread because I was looking for a way to create a /section/title URL scheme. Sungodbiff — I’d feel a lot better about the plugin if it allowed me to do that and just that.
Last edited by Anark (2005-03-18 07:26:53)
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Anark – Agreed with pretty much everything you’ve said. The only thing I’m using now is the ability to have section/title URLs but could also see myself using section/category/title at some point on another site.
I think if you design a site using that URL scheme and stick to it, you won’t run into any problems. Whether you’re using this plugin or not, changing your linking scheme will cause problems for search engines anyway. Its definitely not to change your linking scheme weekly just for fun.
Unfortunately, the bad thing about google pagerank is that when people link to you, the chances that they all use the same anchor text an link are slim anyway.
Points very well taken though.
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
I understand the points above and while I don’t agree 100%, I am addressing the issue. I’m currently in the process of testing sgb_url_handler 0.1.6 and sgb_error_documents 0.1.2.
sgb_error_documents 0.1.2 will add support for 301 Move Permanently and sgb_url_handler 0.1.6 will issue 301s if the parsed URL does not match the currently set URL mode (for articles only; section, category, author, feed and file urls will still be handled normally).
This means if your TxP install is set to serve /section/title and someone accesses an article using /section/id/title they will be redirected to the correct /section/title URL (a 301 will be sent prior to the redirect).
Search engines and savvy browsers can do their update thing and the plugin can fulfill it’s original goal of keeping content available.
I’ve got an alpha build working on my site now, but I need to test it some more before I release it. I’ll probably release them this weekend (tomorrow).
- sgb
Edit: Made some clarifications, just in case there was any confusion.
Last edited by sungodbiff (2005-03-18 17:24:11)
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Do I have to change anything when I upgrade to 0.1.5? With 0.1.3 /section/title used to work but it doesn’t anymore after the upgrade. All I get is a blank page.
When I give the article a category all is well but that puts redundant info in the URL.
Any ideas?
Last edited by andreas (2005-03-18 16:32:59)
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
andreas -
Do you have any other plugins installed? Or did you update TxP?
You might also want to make sure you’ve grabbed the most recent version of 0.1.5 (I had a version posted for about an hour with a typo).
- sgb
Last edited by sungodbiff (2005-03-18 17:05:38)
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
I also use zem_rewrite for my URLs but, as I said, the two plugins got along well together in v0.1.3.
I’ve just downloaded the latest version of your plugin but it didn’t solve the problem. I use the latest revision of TXP (rev231).
There’s no way your plugin could replace zem_rewrite, is there? My most important concern are URLs without ID numbers and I need /section/title as well as /section/category/title.
Thanks for the help.
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
andreas -
Is the problem occurring for one URL or all URLs? Could you post a URL that isn’t working?
I’ve updated my install of TxP and installed zem_rewrite 0.6 so I’ll try to mirror your set-up as best I can.
- sgb
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Well, I don’t use this plugin to fix broken/moved URLs (not just for that at least), but also to use different URL schemes in different sections. In my diary/log sections I want date based URLs, but for my articles I want /section/title, so I’d like for the HTTP status code to be configurable.
If it is not, I’ll fix it by myself, owever…
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
micampe -
That’s very interesting. How are you generating different permlinks for different sections?
With the alpha version (I’m testing now) the plugin compares the parsed URL format to the currently set URL (in the prefs). If they don’t match a 301/redirect is sent. This feature can be disabled, but it is a “global” disable, and not per section (although making it per section wouldn’t be difficult).
- sgb
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
sungodbiff,
the problem occurs for all articles that only have a section assigned to them. If an article also has a category it is loaded no problem. This might be because zem_rewrite works that way, before I used your plugin all articles had to have a category as well as a section. But when I installed the earlier version of your plugin this requirement was gone and I could have category-less articles.
I just read that your plugin checks for the URL mode chosen in the prefs. Could this be the problem? Because no matter which mode I choose, it will be different from the one I use with zem_rewrite.
By the way, I’d also be interested in how to use different schemes for different sections. I’d like to use a date-based one for my blog as well, the rest of the site should have /section/title or /section/category/title
Thanks for all your help!
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Andreas -
Version 0.1.5 doesn’t compare the parsed URL to the currently set permlink mode, so that wouldn’t be the problem.
I’m wondering if perhaps zem_rewrite & sgb_url_handler are interferring with one another. On my site I have a few articles with no categories and I haven’t experienced any problems with them not displaying.
Can you try temporarily turning off zem_rewrite and seeing if the problem still exists?
- sgb
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
When I turn it off, I have to replace the zem_rewrite permlink tag with the original one. Tonight, I don’t have the time for that as I’m off in a minute.
I’ll look into it tomorrow.
Perhaps some more info on zem_rewrite. This is my scheme setup:
<code>
$uri_scheme[‘article_urltitle’] = ‘{section}/{category}/{url_title}’;
$uri_scheme[‘article_alt’] = ‘{section}/{article}/{url_title}’;
$uri_scheme[‘category’] = ‘{section}/{category}/’;
$uri_scheme[‘article’] = ‘{section}/{url_title}’;
$uri_scheme[‘section’] = ‘{section}/’;
</code>
Offline