: Is a .htaccess rewrite rule a potential performance issue? I use a .htaccess rewrite to redirect: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/redirect-to-this-subfolder/ RewriteCond %{HTTP_HOST}
I use a .htaccess rewrite to redirect:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/redirect-to-this-subfolder/
RewriteCond %{HTTP_HOST} ^(www.)?domain-to-redirect-to-subfolder-of-ditto.
RewriteRule ^(.*)$ /redirect-to-this-subfolder/ [L]
Could that become a performance issue for a heavy trafficed site?
More posts by @Kaufman445
1 Comments
Sorted by latest first Latest Oldest Best
Simple answer. No. Absolutely not.
There was a period where people on the net claimed that is was, however, at the time this was going on, Apache had already made changes quite a long time before that make the whole argument moot. It was major-league silliness then, and yet, it still echoes today.
The .htaccess file is cached within the Apache process and a trigger set so that if the file is modified, it gets loaded. There is no re-reading of the file over and over as many claim. If this were true, then the Apache programmers would have to climb a high ladder into the clouds and look up to see poor.
You can load the booger-snots (official technical term) out of your .htaccess file and there will be very little cost in doing so. The caveat is that processing any .htaccess file is recursive. This means that as a rule is applied, the whole set of rules are reapplied. In this, any sets of rules not written properly can cause more than the single recursion. Still, this is so tiny in the world of 2.4Ghz 16 core CPUs that any complaints in any regard is beyond laughable.
In short, get a beer and do not worry about it.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.