[wp-hackers] Rewrite hacking/recreation
Eric A. Meyer
eric at meyerweb.com
Mon Jan 29 21:22:45 GMT 2007
At 4:00 PM -0500 1/29/07, Mark Jaquith wrote:
>Are you sure you've tried it with:
>
> (1) the rewrite rule placed before the WP block
> (2) rewriting to /index.php/foo/?whatever=blah (as opposed to
>/foo/?whatever=blah
> (3) [QSA,L]
#3 helped fix a number of my problems, at least in terms of
returning the actual pages required (HTTP headers may be another
matter). For example,
<http://meyerweb.com/eric/thoughts/recent-links/> works now, as
opposed to before, when it rewrote to the home page of the site
rather than show the results of my PHP script.
Sadly, I still have a couple of problems that won't go away:
1. The feeds, while they exist and are all working now (hooray!),
also get the server to return a 404 header, which seems bad. I'm
pretty sure that's WP's doing, though I can't be absolutely certain.
See the results at
<http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fmeyerweb.com%2Feric%2Fthoughts%2Frecent-links%2Frss2>
as one example. If you then go to
<http://meyerweb.com/eric/thoughts/recent-links/rss2> in a browser or
aggregator, you see the RSS file. (Unless your aggregator is really,
really respectful of HTTP headers and won't load anaything reported
to be a 404.)
I'm kind of afraid that WP is spitting back a bunch of 404s, so
that browsers and search engines think every page in my blog is a
404 page. That would be kind of icky.
2. <http://meyerweb.com/eric/thoughts/> returns a plain old
WP-generated 404. I know it's not Apache doing this, because it's
supposed to serve up a completely different 404 page than the one WP
generates. What I believe to be the related rewrite is:
RewriteRule ^eric/thoughts/$ /eric/thoughts/index.php [QSA,L]
I'm assuming that #2 above has some bearing on this, or maybe it has
to do with Alex's observations, but shut my mouth and paint me red if
know how.
I also have a whole bunch of pretty-permalink rewriting I did on
my own back in the day, and which I assume I could drop now.
Hopefully I will, once I sort the rest of this stuff out...
3. Any 404 on my site (like <http://meyerweb.com/kuhwfs>) now
rewrites to the home page, in flagrant violation of my .htaccess
file, where I define site-wide error pages. I find this to be
entirely uncool. How do I stop it? Change the mod_rewrite stuff for
WP to have a different base than the site's root?
--
Eric A. Meyer (eric at meyerweb.com)
Principal, Complex Spiral Consulting http://complexspiral.com/
"CSS: The Definitive Guide," "CSS2.0 Programmer's Reference,"
"Eric Meyer on CSS," and more http://meyerweb.com/eric/books/
More information about the wp-hackers
mailing list