Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#157 2005-06-19 20:12:10

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Out of the box it didn’t work for me either. I installed both new versions (url_handler and error_documents) and called a URL that didn’t match the default scheme. Nothing happened: the article was displayed.

If I call an invalid URL, I’m taken to the section homepage.

Here are my diagnostic details:

<code>
Textpatternversion: 1.0rc3

Schema der URLs: section_title

Seiten-URL: rete-mirabile.net
PHP-Version: 4.3.10
Register globals: 1
Magic quotes: 1/0
Regionale Einstellungen: de_DE.UTF-8
Server: Apache/1.3.26 (Unix) Debian GNU/Linux FrontPage/5.0.2.2623 PHP/4.3.10 mod_ssl/2.8.10 OpenSSL/0.9.7
Apache-Version: Apache/1.3.26 (Unix) Debian GNU/Linux FrontPage/5.0.2.2623 PHP/4.3.10 mod_ssl/2.8.10 OpenSSL/0.9.7
</code>

Offline

#158 2005-06-19 22:39:47

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Hmm. There is something fishy going on. It seems to be working fine on my site.

The real link:
http://mighthitgold.net/journal/sgb_error_documents

A real link (using another scheme):
http://mighthitgold.net/journal/txp/sgb_error_documents
This results in a 301 & redirection to the first link.

An incorrect link:
http://mighthitgold.net/journal/THISISWRONG/sgb_error_documents
This results in a 404.

My sgb_url_handler_config():
<code>// Defines which mode to match</code>
<code>$config[‘match’] = ‘exact’;</code>

<code>// Send 301 redirects?</code>
<code>$config[‘send_301’] = 1; // bool</code>

<code>// Send 404 not founds?</code>
<code>$config[‘send_404’] = 1; // bool</code>

My sgb_error_documents_config():
<code>// 301 Moved Permanently</code>
<code>// Do not change the 301 unless you know what you’re doing!</code>
<code>$r[‘error_documents’][‘301’][‘id’] = null;</code>
<code>$r[‘error_documents’][‘301’][‘url’] = 1;</code>
<code>$r[‘error_documents’][‘301’][‘file’] = null;</code>
<code>$r[‘error_documents’][‘301’][‘text’] = null;</code>

<code>// 403 Forbidden</code>
<code>$r[‘error_documents’][‘403’][‘id’] = null;</code>
<code>$r[‘error_documents’][‘403’][‘url’] = null;</code>
<code>$r[‘error_documents’][‘403’][‘file’] = null;</code>
<code>$r[‘error_documents’][‘403’][‘text’] = null;</code>

<code>// 404 File Not Found</code>
<code>$r[‘error_documents’][‘404’][‘id’] = 40;</code>
<code>$r[‘error_documents’][‘404’][‘url’] = null;</code>
<code>$r[‘error_documents’][‘404’][‘file’] = null;</code>
<code>$r[‘error_documents’][‘404’][‘text’] = null;</code>

But it’s clearly not working properly on your sites. At this point I’m not sure what’s wrong I’ll continue to play around with it and figure out what could be happening.

If you know, could you post which revision of TxP your using e.g. 1.0RC3 r243.

Thanks!

- sgb

Last edited by sungodbiff (2005-06-20 03:12:43)

Offline

#159 2005-06-20 06:11:52

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

rev 406 — I don’t have to use the tag provided to get the plugin workin, do I? I just installed the two and made the basic configuration, although for error_docs I didn’t provide any data for the 404s but the 301s should be working anyway, shouldn’t they?

I have it installed on www.rete-mirabile.net

Offline

#160 2005-06-20 15:04:33

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Mine is rev 406 as well, before that the plugins acted the same, I don’t know which rev it was, got it from deanload in the first week of May I think.

My configs are exactly the same as yours.

In case diagnostics tell you something:

Textpattern version: 1.0rc3
Document root: /home/httpd/vhosts/doggiez.nl/httpdocs
$path_to_site: /home/httpd/vhosts/doggiez.nl/httpdocs
Textpattern path: /home/httpd/vhosts/doggiez.nl/httpdocs/textpattern
Permanent link mode: section_title
open_basedir: .:/home/httpd/vhosts/doggiez.nl:/tmp:/usr/share/pear
upload_tmp_dir: /tmp
Temp folder: /home/httpd/vhosts/doggiez.nl/httpdocs/textpattern/tmp
Site URL: www.doggiez.nl
PHP version: 4.3.11
Register globals: 1
Magic quotes: 1/0
Locale: en_GB.UTF-8
Server: Apache/2.0.46 (Red Hat)
Apache version: Apache/2.0.46 (Red Hat)

.htaccess file contents:
————————————
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php

————————————

Last edited by doggiez (2005-06-20 15:05:56)

Offline

#161 2005-06-21 00:55:54

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

It seems to be a problem with sgb_error_documents and the newer revisions of TxP. I was using a version from March/April.

Working on it now.

Update: Okay, it’s not a problem with sgb_error_documents per se, it’s a problem with how <code>sgb_error_document()</code> is being checked in <code>sgb_url_handler_config()</code>.

- sgb

Last edited by sungodbiff (2005-06-21 01:04:06)

Offline

#162 2005-06-21 01:37:56

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Okay, problem found. I’ll post more in a few minutes after I try a couple of solutions.

- sgb

Offline

#163 2005-06-21 02:48:52

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

doggiez & andreas -

After much trial and error I figured out what was going on. In short, recent versions of TxP executed plugin code differently. Plugin code used to be strung together and <code>eval()</code>‘d at the same time — this meant plugins could reference code in other plugins (as sgb_url_handler and sgb_error_documents do). In recent versions this behavior changed, each plugin is <code>eval()</code>‘d separately — meaning plugins can’t reference code in other plugins. I’m hoping this changes as I’d like sgb_error_documents to be accesible by any and all plugins that want to use it.

And on that note, I don’t want to officially combine the two plugins, so you’ll need to download the newest versions (links are posted in the first post of this tread and on my site): sgb_url_handler 0.1.8.3 and sgb_error_documents 0.1.2.2.

Edit: These instructions are only necessary if your install of TxP lacks the function <code>include_plugin()</code>

1. Install sgb_url_handlers 0.1.8.3
2. Install sgb_error_documents 0.1.2.2
3. Configure each plugin per normal
4. Edit sgb_error_documents and copy all the code (you don’t need to save after copying)
5. Return to the plugins page
6. Edit sgb_url_handler, delete or comment out the line that says <code>include_plugin(‘sgb_error_documents’);</code>
7. Paste all the code you copied from sgb_error_documents above the line you just commented out (or deleted)
8. Save the changes and return to the plugins page
9. Activate sgb_url_handler — you don’t need to activate sgb_error_documents.

It should work now. There were a few misc. changes to both plugins so you’ll want to update to the versions above.

At this point I’m going to keep the plugins separate and see if I can’t get TxP to switch back to the old style plugin deal.

Sorry for the confusion. Let me know if it works for you now.

- sgb

Last edited by sungodbiff (2005-06-22 00:49:37)

Offline

#164 2005-06-21 13:37:01

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

THANK YOU SG!
finally got my 404s to work :*


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#165 2005-06-21 14:28:58

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Perfect sgb!!! It’s working! Thank you for all your trouble.

Offline

#166 2005-06-21 14:34:47

nicklas
Member
Registered: 2004-04-13
Posts: 12
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Gah, well, it did fix the 404’s a bit too good for me. If I install sgb_url_handler 0.1.8.2 it requires a carbonatedink.com/index.php — if just carbonatedink.com/ it gives a blank screen. sgb_url_handler 0.1.8.1 works fine except that sgb_error_documents 0.1.2.1 won’t give a 404 if the url is faulty.

If I paste the error_documents into the url_handler-plugin it returns a 404 instead of a black screen when carbonatedink.com/ is used — carbonatedink.com/index.php works fine though.

Offline

#167 2005-06-21 15:27:36

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Slightly off topic, but…

Has anyone else had a problem where textpattern returns the home page regardless of whatever non-existent page was requested. Mydomain.com/theresnopagewiththisname always presents the home page.

I was hoping to use sgb_errors to get past this.

Last edited by mrdale (2005-06-21 15:33:57)

Offline

#168 2005-06-21 15:32:48

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Not off topic at all, and yes – that is the purpose of this plugin pair.

Offline

Board footer

Powered by FluxBB