WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Nothing was Found page after posting a comment (5 posts)

  1. spieprzajdziadu
    Member
    Posted 7 years ago #

    I have just upgraded from WordPress 15.1.2 to 2.0.4. Almost everything went smoothly, but I have a comment - related problem. When a user posts a comment, he/she is redirected to the "Nothing was Found" page. The comment is recorded for moderation in case of new users or posted immediately for registered users (which is ok according to my settings).
    After the upgrade I also changed from "?p=123" links to title-based links. When I change back, the problem disappears, but I'd like to keep that setting without getting errors :)

  2. mickemus
    Member
    Posted 7 years ago #

    check if you have a .htaccess in your wp root folder... and while your at it is it writable by the server. if everything seems ok with it, rename it (unless you've edited and added your own stuff in it) and reapply your permalinks!!

  3. spieprzajdziadu
    Member
    Posted 7 years ago #

    mickemus, this did not solve the problem. I changed both the .htaccess and the root directory to rwxrwxrwx. I changed permalinks from "numers" to "titles" and the problem persists. Then I removed .htaccess and the result was the same. No changes were made to .htaccess by the WordPress engine.

  4. spieprzajdziadu
    Member
    Posted 7 years ago #

    More info coming: learned from my hosting company that they run IdeaWebServer with mod_rewrite. Just a little change to wp-includes/vars.php made WordPress write to .htaccess with the following entry:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    The blog still works fine, all links are OK, but posting a comment still ends on "Nothing was Found" page :(

  5. spieprzajdziadu
    Member
    Posted 7 years ago #

    After a lot of debugging I found out that the problem was "//" sent to wp_redirect in wp-comments-post.php (where did it come from? I don't know). So i had to replace in wp-comments-post.php

    $location = ( empty( $_POST['redirect_to'] ) ) ? get_permalink( $comment_post_ID ) : $_POST['redirect_to'];

    wp_redirect($location);

    with

    $location = ( empty( $_POST['redirect_to'] ) ) ? get_permalink( $comment_post_ID ) : $_POST['redirect_to'];

    $output = $location[0]=="/" ? substr($location,1) : $location;

    wp_redirect($output);

    And it worked...

Topic Closed

This topic has been closed to new replies.

About this Topic