[wp-hackers] Rewrite Experiment

Ryan Boren ryan at boren.nu
Sat Sep 18 19:15:33 UTC 2004


On Sat, 2004-09-18 at 13:35 -0400, Mark Jaquith wrote:
> Ryan Boren wrote: 
> > 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
> > 
> > 
> > _______________________________________________
> > hackers mailing list
> > hackers at wordpress.org
> > http://wordpress.org/mailman/listinfo/hackers_wordpress.org
> > 
> > 
> >   
> I'm still having problems with pathinfo feeds in CVS.
> 
> Here's the lowdown:
> 
> blog URI: http://txfx.net/wp_test/  (I update it to most recent CVS
> just about daily.)
> 
> Settings:
> Wordpress address: http://txfx.net/wp_test
> Blog address: http://txfx.net/wp_test
> Permalink structure: /index.php/%year%/%monthnum%/%day%/%postname%/
> 
> Now notice on the main page that the link to the RSS on the sidebar is
> to http://txfx.net/wp_test//feed/rss2/  (double slash intentional)

Alright, this is because the 'blogfilename' option is now empty for new
installations.  We need to replace all occurrences of get_settings
('blogfilename') with index.php.

Ryan




More information about the hackers mailing list