[wp-hackers] Need Help, I cannot figure this out.

Dave Viner dave at vinertech.com
Fri Feb 5 16:58:28 UTC 2010


I definitely agree with Mike.

Here's an interesting test that I just ran.

% lwp-request -SUse "http://mrsec.com/about" | less
GET http://www.mrsec.com/story/about-12-minutes-of-good-basketball
User-Agent: lwp-request/5.810

GET http://mrsec.com/about --> 301 Moved Permanently
GET http://www.mrsec.com/story/about-12-minutes-of-good-basketball --> 200
OK
Connection: close
Date: Fri, 05 Feb 2010 16:50:53 GMT
Server: Apache/2.2.9 (Debian) DAV/2 PHP/5.2.6-1+lenny4 with Suhosin-Patch
mod_ssl/2.2.9 OpenSSL/0.9.8g mod_perl/2.0.4 Perl/v5.10.0
Vary: Accept-Encoding
...

As you can see requesting the "About" page caused the server to issue a 301
to the "About 12 minutes of Good Basketball" page.  This suggests that
there's likely something wrong in your rewrite rules.  I would guess that
the redirect occurs because the URL /about matches the beginning of the
story URL (/about-12-mintes...)

I'd look first to see if Apache is doing some rewriting itself.  Are there
special rewrite rules you've enabled in the apache config?

Alternatively, you can uncomment these lines from your apache config:

#<IfModule mod_rewrite.c>
      #RewriteLog "/var/www/vhosts/mrsec.com/statistics/logs/rewrite_log"
      #RewriteLogLevel 9
      #</IfModule>

But, don't set RewriteLogLevel to 9.  Anything over 3 is a *massive* amount
of information.

If there are no special rules in the apache config or .htaccess, then, I'd
move on to look at WordPress.

The next thing to test would be the rewrite rules that are operating inside
WordPress.  Something in there is matching titles too loosely.  I *suspect*
that there's some regular expression that doesn't have the right start/end
token in the regex (such that "/about-12-minutes.." matches "/about").

Are you using any WP plugins to manage redirects or canonical URL creation?

Dave Viner


On Fri, Feb 5, 2010 at 1:22 AM, Mike Little <wordpress at zed1.com> wrote:

> Jeremi
>
> A couple of things to check, when the wrong page is delivered, e.g. rss
> feed
> instead of about page, what does the apache log record? It will likely be
> difficult to check when the site is busy but looking for a know ip address
> at a specific time will help you tie it down. Does the apache log record
> the
> the request was for about or for the feed? If for the about page, then you
> can rule out external, influences. I suspect you have got to that stage
> already.
> The next thing is to tie that request in with the rewrite logs  - I think
> Shane has already determined that things look ok.
>
> So you are probably back to something going wrong within WordPress'
> execution chain.
>
> It may be a shot in the dark, but I once had a vaguely similar issue with a
> client's site. In this case the page title was being set to the wrong
> thing.
> So the home page might  have a title tag of search results! It
> was intermittent (but was then cached by a front end caching server!) but
> was defintiley happening under high load.
>
> I had just enabled All in one SEO plugin, and when I turned it off again,
> it
> went away.
>
> I think it was going wrong because AIOSEO does whole page buffering and I
> believed that there might be a threading issue  with specific versions of
> PHP and output buffering. So that the buffered contents of one request were
> returned to the code running a different request. In my case the site was
> running an out of date version of PHP, and running on Windows.
>
> I see you are not running on Windows, but I think it is worth checking
> these
> two things.
> Are you running a plugin that does lots of output buffering?
> and is your version of PHP up-to-date?
>
> Another thing I would try: When you get a wrong page - save the HTML and
> headers. Then access the page you received directly and save the HTML and
> headers. Compare the two pairs (possibly ignoring time stamps). If they are
> identical, then the error may well be in the template/redirection logic
> within WordPress and it's plugins.
> If they are different, then I would more strongly suspect output buffering.
>
>
>
> Hope this helps,
>
>
> Mike
> --
> Mike Little
> http://zed1.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list