Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-12-20 07:10:32

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

Re: Error 404 on article save after preview

Wouldn’t that be visible in the HTTP header dump? I used HTTPLiveHeaders with FF, and it showed an immediate sequence of the POST request and the 404 response.

Yes. If you’re not seeing a 301 or 302 status with LiveHeaders, there’s no redirect.

So:

  • The URL in the browser nav bar is /textpattern/index.php (the admin interface)
  • There’s no redirect
  • But, PHP seems to be loading /index.php (the public site), which immediately triggers a 404.

Best ideas I have:

  1. The backtrace is wrong (not impossible, but I can’t find any reports of it failing completely like this due to eval or similar)
  2. Something inside Textpattern (plugin?) is triggering a virtual() call (unlikely)
  3. Something outside PHP (Apache?) is triggering an internal redirect or rewrite (one that isn’t sent to the browser as a 301/302 response)
  4. Something is happening in the browser that’s not showing up in LiveHeaders (javascript?)
  5. Something much simpler is happening, and I’m overlooking it

My money’s on (3) or (5). Perhaps some kind of spam redirection or rewrite cleverness at the server level. (Just as Sencer suggested, like, yesterday, heh)


Alex

Offline

#14 2005-12-20 07:18:05

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Error 404 on article save after preview

Thanks.

I’ll put it into the X files for a while, as it is no show stopper but just annoying. Maybe I will be able to collect more hints as time passes.

//w&

Offline

#15 2005-12-20 09:05:03

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

Re: Error 404 on article save after preview

wet, if it’s possible, can you remove your .htaccess file and try your thing again. I wonder whether you’ll get a 404 error again, or something else.

Offline

#16 2005-12-20 10:23:16

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Error 404 on article save after preview

On removal of .htaccess, I am encountering this message:

Forbidden
You don’t have permission to access /textpattern/index.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Strange things piling up…

Last edited by wet (2005-12-20 10:23:56)

Offline

#17 2005-12-20 10:26:35

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

Re: Error 404 on article save after preview

Alrighty! So the real issue seems to be that you are getting a “Forbidden” from the webserver for your POST. If I was you, I would leave it like that, and contact your host, asking why some POSTs to the url are ok, and other result in a “Forbidden” message. Hopefully he will have an answer.

Offline

#18 2005-12-20 10:56:28

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Error 404 on article save after preview

I consider this item solved, at least from a textpattern point of view. Thank you both for walking through this so thoroughly.

Adding one plus one resulted in me suspecting that this thread is somehow related and so this current thread solved my problem with password protected directories over there. Jippie!

Last edited by wet (2005-12-20 11:42:36)

Offline

#19 2005-12-20 13:04:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Error 404 on article save after preview

> Sencer wrote:

If I was you, I would leave it like that, and contact your host…

Hosting support confirmed and resolved this issue:

You are triggering a POST content filter, meant to stop hacker/spammers. Also, I’ve made a small temporary change, I’d like you to test.

So I did, and everthing works fine now.

Offline

#20 2005-12-23 04:24:01

visualpeople
Member
From: Corvallis, Oregon - USA
Registered: 2005-11-16
Posts: 73
Website

Re: Error 404 on article save after preview

Wet —

Can I get you to elaborate a little more on what you finally did to get things fixed?

I have a plugin that is doing similar things — I can’t have any lines that have any reference to javascript in them or I get a 404 error when I hit save after editing the plugin.

For example:
<code> $out .= ‘<script src=”’.$scriptPath.‘sifr.js” type=“text/javascript”></script>’.”\n”; </code>
returns an error, but take the line out and the edits to my plugin work just fine.

I can upload a plugin with that code in it from the “Install plugin” box but it’s a no-go on editing.

I’m going to bring this up with my hosting company, but I’d like to be a little more informed before I contact them.

-Ryan

Last edited by visualpeople (2005-12-23 04:30:38)

Offline

#21 2005-12-23 04:58:22

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Error 404 on article save after preview

I did nothing more than what Sencer suggested: Removed my .htaccess to get an unfiltered server error message instead of Textpatterns 404 page.

So I got to know which was the real error causing that final redirect in Textpattern, in my case the server responded with the above mentioned “403 causing 404” message.

I finally asked my hosting provider why this could happen citing a verbatim copy of the server message I received and they immediately responded that this was caused by a counterspam measure which they tweaked a little in order to make my post come through without errors. After I finally knew what was going on it was merely a matter of minutes to have this fixed.

The key point for me is: Whenever you experience server related difficulties with spuriuos error messages try removing / renaming .htaccess and let the server handle the errors all by itself. This will of course disable clean URLs while .htaccess is out of order, but it only requires a very limited amount of time so that it wouldn’t impose any problems on an site with limited traffic.

//w&

Last edited by wet (2006-11-02 08:56:56)

Offline

#22 2006-02-12 19:12:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Error 404 on article save after preview

I know this is an oldish thread but I’ve just had a similar thing here with a “404”-style error showing up when publishing.

I was trying to post an article informing the world of our new album that’s available to buy (the page has a PayPal “Buy Now” link in it) and the page refused to publish.. just sat there idling for over 2 minutes before I got bored and cancelled it. It wouldn’t preview either.

Removing random chunks of text (including the PKCS7 code that PayPal supplied) stopped it idling but then I got my error_default message instead. I removed a few more lines and also renamed my .htaccess as Sencer suggested: that showed I was actually getting a 500 Internal Server Error… what the…? My error logs gave me no clues as to why, just reported that it couldn’t find a 500.shtml file to display.

So I stripped the page back to a single word and hit Publish: fine, no problems. Re-instated my .htaccess, added a word or two to the article: published fine. Added the PKCS7 back in: fine(!) Pasted another sentence of text in: booom, error time. Removed the sentence and pasted a few words at a time until I found the culprit. And it was… deep breath…

CD

Yes, the word ‘CD’ was tipping it over the edge. Go figure. If I pasted in the original text that I was trying to post, and swapped that word out everywhere it occurred in the article with “album” or “disc” or something, it published fine. But leaving it in there, anywhere in the article, and it failed to publish. Incidentally, publishing a simple test article containing a sentence including the word ‘CD’ is fine. It was just when used in that particular article.

Since a few people have had problems with their hosters’ counterspam settings I can only assume this is what I was hitting. I’ve also had the same thing when uploading a particular image with certain alt/caption text. Quite why I was getting a 500 (thanks Sencer for the hint about renaming the .htaccess .. genius) is a mystery but the moral of the story is if Textpattern appears to be playing up when you’re posting stuff, strip your article back and build it up sentence by sentence to find the offending word, then go dig out your thesaurus :-)

Edit: It was my ISP. I emailed them the details and they “fixed it”. They didn’t say what caused it, but it was definitely something server side triggering this odd behaviour.

Last edited by Bloke (2006-02-27 11:03:34)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB