[wp-hackers] Rewrite Experiment

Ryan Boren ryan at boren.nu
Sat Sep 18 17:02:54 UTC 2004


On Sat, 2004-09-18 at 05:03 -0400, Mark Jaquith wrote:
> Ryan Boren wrote:
> 
> >Get rid of all of your rewrite rules and replace them with this:
> >
> >RewriteEngine On
> >RewriteBase /
> >RewriteCond %{REQUEST_FILENAME} !-f
> >RewriteRule ^(.+)$ /index.php/$1
> >
> >Adjust your base accordingly.  If you're running from a subdir, let's
> >say "wordpress", you'll need:
> >
> >RewriteEngine On
> >RewriteBase /wordpress/
> >RewriteCond %{REQUEST_FILENAME} !-f
> >RewriteRule ^(.+)$ /wordpress/index.php/$1
> >
> >Does it work?
> >
> >Ryan
> >
> Yeah, I e-mailed Matt with a similar scheme a few days ago.  I've been 
> testing it and it works great.

Matt forwarded me your email, which prompted me to get off my ass and
start looking at this again.  It's a nifty solution.

>   The only problem right now is that 
> pathinfo appears to be broken for feeds.  
> site.com/wordpress/index.php/feed/atom/ won't work using latest CVS, it 
> just returns the blog's home page.  The same thing can be seen on 
> Craig's site ( http://blog.nuclearmoose.com/feed/rss2/ ).

I have no problem with pathinfo feeds in CVS.  1.2 does not support
feeds via pathinfo, but CVS "should" be fine.  I'll look into it.

> Upsides of this method: no need to update rules with new WordPress 
> version of URI scheme.  Simplification of all the mod_rewrite rule 
> creation code.

There's lots of upside, assuming it works for everyone.  If anyone is
running Apache 1.3, I'd be particularly interested in knowing if this
works.  mod_rewrite in 1.3 has a number of bugs and missing features
that we have to work around.  If this works, we can handily avoid all of
those bugs.

Ryan




More information about the hackers mailing list