New answers tagged

0

It looks like your logic is backward but mod_rewrite may help you: RewriteMap lc int:tolower RewriteMap nocache "txt:/files/cache/static/xyz.cache" RewriteCond /var/www/files/cache/static/${lc:%{REQUEST_URI}}.cache !-f RewriteRule files/cache/static/[A-Za-z_\-0-9]+.cache ${nocache:foo} [L] Rather than putting just the destination URL in /files/cache/...


19

The recommendation from the Apache project is: In general, you should only use .htaccess files when you don't have access to the main server configuration file. ... a common misconception is that user authentication and mod_rewrite directives must go in .htaccess files. So please both set AllowOverride None and all your other directives in the main ...


1

I have tested with and without .htaccess and could really find no difference in speed or overhead whatsoever. Granted I only run 16 sites and it's a super fast server so in my case tracking milliseconds is almost impossible. On a server running hundreds of sites the overhead may be noticeable so as @Iain said test and see. I personally do everything using ...


1

I don't believe there is a single right answer for your question. Are many variables which can affect htaccess load time: Site folder structure: all .htaccess in each folders are loaded every time the page is open. How long is the htaccess file: 200 lines vs 3500 lines? there is a big difference. .htaccess configuration: rewrite and redirects rules can be ...


4

The expense depends upon how powerful the server is in particular it's storage I/O subsystem and whether there is any caching involved. The way to test it is to configure your system with .htacess and load test it in the same way as you would any web server. Then configure the system without .htaccess and run the same tests. Compare and contrast the ...


0

Have you tried changing your Apache log format by adding %T/%D ? For a start this will add the seconds & microseconds that a request took. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" **%T/%D**" combined As far as logging each php script and how long it took, have a look through the code provided on this solution at ...



Top 50 recent answers are included