Forums

WP error when pasting PHP+HTML code (8 posts)

  1. derossi83
    Member
    Posted 11 months ago #

    Hello,

    I'd like to use my WP to post codes (PHP, html...etc). When I do paste some amount of code (67 lines of PHP and html mixture), after pressing the "publish" button I get an "Not found" error, saying : "The requested URL /wp-admin/post.php was not found on this server."

    I don't have this problem when I post articles without codes. I tried to use Quickcode, tried to add the code in between [code] or
    [pre] tags, tried to add the actual code in both visual and code views but nothing changed it.

    It was a bit annyoing after finishing one kinda long article to get this error message. Any helps wouldd be appriciated.

    Cheers :)

  2. themesbycal
    Member
    Posted 11 months ago #

    Check out the wp-syntax plugin, should do what you need

  3. derossi83
    Member
    Posted 11 months ago #

    thanks for the suggestion.

    it still won't let me post that specific code. However if I delete like 25% out from the code it let's me go through. Any suggestions?

  4. workman
    Member
    Posted 11 months ago #

    Was doing a search on the same error (404 on post.php) when I found this thread =]

    My coworker just had mentioned that sometimes mod_security on the serverside may recognize a request as spam and not serve the page at all as a precaution.

    I was trying to post an article that referenced blogspot.com and it was rejected. After running the URL through tinyURL, it works. Go figure =/

    If it is mod_security, you'll just have to narrow it down to what link(s) it may be. Hope it helps.

  5. derossi83
    Member
    Posted 11 months ago #

    hmmm. I didn't have any issues with URL-s. The problem was-actually the problem still is- that if I'd like to post an article with -let's say - 50 lines of code it gets rejected.

    however if I post the same thing in batches, I get no errors. :(

  6. derossi83
    Member
    Posted 9 months ago #

    okay, I now have the solution...sort of.

    I found out what caused this error :) its really funny. I did this investigation paragraph-by-paragraph, then sentence-by-sentence and finally word-by-word. It turns out that the reason why the posting fails is because of one simple word. "Fetch". Try to enter this word only to a post, and see the 404 error afterwards....

    probably there are some workarounds for this :) So fetch it for yourself :D

  7. moshu
    Moderator
    Posted 9 months ago #

    There are quite a few similar words (mainly those that could be commands in a script) that would cause similar issues; e.g. curl, mkdir etc.
    There was a fix posted:
    http://wordpress.org/support/topic/120012?replies=5

  8. derossi83
    Member
    Posted 9 months ago #

    yeah, i took the .htaccess what they recommended there, and it now works! excellent! :)

Reply

You must log in to post.

About this Topic