[wp-hackers] .htaccess cleanup

Kimmo Suominen kimmo+key+wordpress.c4f53f at suominen.com
Sun May 22 19:05:11 GMT 2005


On Sun, May 22, 2005 at 07:27:16PM +0000, Jonathan Leighton wrote:
> Jeff Minard wrote:
> 
> > Jonathan Leighton wrote:
> >
> >> Or you could combine the two...
> >>
> >> RewriteRule ^(.+)/trackback/?$ /index.php?pagename=$1&tb=1 [QSA,L]
> >> RewriteRule ^(.+)/feed/(feed|rdf|rss|rss2|atom)/?$
> >> /index.php?pagename=$1&feed=$2 [QSA,L]
> >> RewriteRule ^(.+)/(feed|rdf|rss|rss2|atom)/?$
> >> /index.php?pagename=$1&feed=$2 [QSA,L]
> >> RewriteRule ^(.+)/page/?([0-9]{1,})/?$
> >> /index.php?pagename=$1&paged=$2[QSA,L]
> >> RewriteRule ^(page1|page2|page3)/?([0-9]+)?/?$
> >> /index.php?pagename=$1&page=$2 [QSA,L]
> >>
> >> Granted it's not *as* specific... but probably faster?
> >>
> >
> > Faster, no idea...gosh, I wouldn't even know how to test that for speed.
> 
> Well, I'm just assuming that saying (in code of course) "match any
> character" is faster than saying "match this phrase, or that phrase, or
> that phrase, or that phrase". But yeah, I wouldn't know either.

Typically regexp parsers stop as soon as they can determine a failure
(no match).  So a limited number of characters (as both in options for
each position of the string and in total length) should be faster than
something that can match the whole string.

Regards,
+ Kim
-- 
<A HREF="http://kimmo.suominen.com/">Kimmo Suominen</A>



More information about the wp-hackers mailing list