0

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 2

6

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Since mod_rewrite is using regex, i think you'd rather have to optimize your regex !

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.