Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2004-07-08 10:16:59

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: [plugin] [ORPHAN] zem_redirect

I am still getting circular redirects, however this may be due to my blog having imported entries from b2. I guess this won’t happen if you only have entries made with textpattern.

An example can be seen here:

http://www.sencer.de/article/50/openbook----freie-b%EF%BF%BDcher

There are some “funny characters” in the url, anyway I have test-mode activated and I always get this:

<code>requested URL: http://www.sencer.de/article/50/openbook----freie-b%EF%BF%BDcher redirect to: http://www.sencer.de/article/50/openbook----freie-b�cher</code>

Last edited by Sencer (2004-07-08 10:19:12)

Offline

#17 2004-07-09 04:18:50

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_redirect

Thanks for the report, Sencer – it’s a bug in the plugin’s handling of non-ascii characters. Nothing to do with b2. I’ll fix this and the other outstanding issues soon.


Alex

Offline

#18 2004-07-09 06:18:04

ThrokFeroth
Member
From: Malaysia
Registered: 2004-02-28
Posts: 12
Website

Re: [plugin] [ORPHAN] zem_redirect

Funny thing really. When I put in the test attribute this is what comes out:

requested URL: http://www.relativemind.net/
redirect to: http://relativemind.net/

when I requested for http://relativemind.net.

Offline

#19 2004-07-09 07:08:25

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_redirect

Hmm, strange.

The domain name in the “requested URL:” output comes from the SERVER_NAME variable. That’s supposed to be the current vhost name, but it’s not necessarily clear whether that’s always the case – for example after a 302 redirect, which is what you’re using in addition to the plugin.

I’ll add an option to the next version to ignore the domain name portion of the URL. Hopefully that’ll solve the problem for you.


Alex

Offline

#20 2004-07-10 02:38:49

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_redirect

There’s a new version up:

http://vigilant.tv/documents/tp/zem_redirect-0.5.txt

Changes:
  • Adds a new attribute “ignoredomain”, to help eliminate circular redirects on www/no www domains
  • Adds a new attribute “errorid”, which specifies an article ID to display as a 404 message
  • Now checks that the URL section matches the article section, and redirects if necessary – useful if you’ve moved an article from one section to another
  • Should fix the non-ASCII URL bug (untested)

Alex

Offline

#21 2004-07-10 07:54:04

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: [plugin] [ORPHAN] zem_redirect

> zem wrote:
> Should fix the non-ASCII URL bug (untested)

Confirmed. For me it works as expected now. Thank you, zem! :)

Offline

#22 2004-07-10 13:12:17

ThrokFeroth
Member
From: Malaysia
Registered: 2004-02-28
Posts: 12
Website

Re: [plugin] [ORPHAN] zem_redirect

Ok, it works well on my site now with the ignoredomain attribute. The /default problem isn’t there either.

Thanks alot, zem.

Offline

#23 2004-09-28 22:38:13

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

Re: [plugin] [ORPHAN] zem_redirect

I have a weird behavior from this plugin. I’ve set up a new section & page type for errors. If you request a non-existent article id the plugin behaves fine & throws a 404 invisibly. But it you just put in nonsense after the domain (a non-existent section) then the plugin redirects you straight to the error page, not invisibly as an ErrorDocument should.

Edit: this isn’t referring to my personal site; it’s an internal site unfortunately not accessible from outside my work

Last edited by compooter (2004-09-28 22:42:06)

Offline

#24 2004-10-13 03:01:20

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: [plugin] [ORPHAN] zem_redirect

Hi Zem

Great plugin!

Any chance that you could include the option of providing an acticle id for Authorization Required, 401?
/Hafnius


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#25 2004-10-13 05:40:27

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_redirect

Hafnius,

You can (and should) handle that with a regular .htaccess ErrorDocument.

The plugin can’t do it because it has no way to intercept errors – it can only handle those generated by the plugin itself. (Which I think explains Compooter’s query above – the plugin can’t act as an ErrorDoc handler for things that occur outside of Texpattern, such as a missing section file)


Alex

Offline

#26 2004-10-13 14:01:57

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: [plugin] [ORPHAN] zem_redirect

Aahhh I see – thanks for the clarification.


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#27 2004-10-31 04:00:28

misterk
Member
From: Morris, MN
Registered: 2004-02-24
Posts: 77
Website

Re: [plugin] [ORPHAN] zem_redirect

zem – I think this plugin is redirecting http://station11.net/log/234/#comment to http://station11.net/log/234/photos-from-france. Has anyone else noticed this? I could just be misinterpreting the comments_invite function and passing it the wrong variables.

<code>[kjell@imac:~] % curl -I http://station11.net/log/234/#comment
HTTP/1.1 301 Moved Permanently
Date: Sun, 31 Oct 2004 03:54:04 GMT
Server: Apache
X-Powered-By: PHP/4.3.8, The blood, sweat and tears of the fine, fine TextDrive staff
Location: http://station11.net/log/234/photos-from-france
Vary: Accept-Encoding
Served-By: TextDrive
Connection: close
Content-Type: text/html; charset=UTF-8</code>

There’s the pages information, and here is how the part of my plugin which generates the comments link looks like: $comments = comments_invite($AnnotateInvite,$Section,$ID);. My fault or the plugins?

Last edited by misterk (2004-10-31 04:01:14)

Offline

#28 2004-10-31 09:58:06

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_redirect

A web browser shouldn’t send the ‘#comment’ part in the GET request, though some might under certain circumstances. Have you seen this happen with a browser?


Alex

Offline

#29 2004-10-31 17:12:34

misterk
Member
From: Morris, MN
Registered: 2004-02-24
Posts: 77
Website

Re: [plugin] [ORPHAN] zem_redirect

I don’t think it is… it’s in the url, as an identifier. A 301 is returned, and php redirects the page to /title. I don’t see where anything is in a get, but when you load it in a browser you just get redirected just like curl says.

Offline

#30 2004-10-31 21:49:51

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_redirect

Oh, right, I misread the URL. The web browser requests ‘http://station11.net/log/234/’, and the plugin redirects it to ‘http://station11.net/log/234/photos-from-france’. Firefox handles this correctly, and tacks ‘#comment’ on the end of the new URL; IE doesn’t.

The ‘#comment’ part normally isn’t sent to the server, so the plugin doesn’t have an opportunity to do anything about it.

As of 1999, only about one third of Web browsers re-applies the fragment identifier to the redirected URL.

A quick google suggests this is an open problem.


Alex

Offline

Board footer

Powered by FluxBB