My server support tells me my htaccess URL rewrites are causing an overhead. I use URL rewriting for "nicer" URLs, mainly (like example.com/?foo=bar will be example.com/foo/bar or so). Generally speaking, what are some tips & tricks to keep in mind when aiming to optimize the htaccess RewriteEngine?
2 Answers
Move as many .htaccess directives (including mod_rewrite rules) into the httpd configuration (httpd.conf) - this is only read once, on server restart, rather than on per-request, per-directory. Beyond that, unless you've got either an excessive amount of rewrite rules, or an incredibly complex individual rule, there's not much to it.