This suggestion is put forward by ghacks.net -- Speed Up Wordpress With Better Permalink Rewrite Code As I understand it, the way ghacks has organized the code reduces unnecessary "calls" and "checks"
Simply, you paste the following into your.htaccess file replacing what's already there between "# BEGIN WordPress" and "# END WordPress".
Code to be pasted:
Code:
# BEGIN WordPress # RewriteEngine on # # Unless you have set a different RewriteBase preceding this point, # you may delete or comment-out the following RewriteBase directive # RewriteBase / # # if this request is for "/" or has already been rewritten to WP RewriteCond $1 ^(index\.php)?$ [OR] # or if request is for image, css, or js file RewriteCond $1 \.(gif|jpg|php|ico|css|js)$ [NC,OR] # or if URL resolves to existing file RewriteCond %{REQUEST_FILENAME} -f [OR] # or if URL resolves to existing directory RewriteCond %{REQUEST_FILENAME} -d # then skip the rewrite to WP RewriteRule ^(.*)$ - [S=1] # else rewrite the request to WP RewriteRule . /index.php [L] # # END wordpress
AND, while I'm at it -- in looking at one of my .htaccess files I find what looks like a duplication:
Code:
1. <IfModule mod_rewrite.c> 2. RewriteEngine On 3. RewriteBase / 4. RewriteCond %{REQUEST_FILENAME} !-f 5. RewriteCond %{REQUEST_FILENAME} !-d 6. RewriteRule . /index.php [L] 7. </IfModule> 8. # BEGIN WordPress 9. <IfModule mod_rewrite.c> 10. RewriteEngine On 11. RewriteBase / 12. RewriteCond %{REQUEST_FILENAME} !-f 13. RewriteCond %{REQUEST_FILENAME} !-d 14. RewriteRule . /index.php [L] 15. </IfModule> 16. # END WordPress 17. redirect 301 /nostdir.html http://www.hatchtown.com/tools/misc-tools/nosting 18. redirect 301 /strait.html http://www.hatchtown.com/tools/spindles/spindle-hook-tuning
Question: Is the code in lines 1. - 7. accomplishing anything that won't be done by 8. - 16.? Can I just delete those lines?
Jim
PS _ I was going to ask WHICH .htaccess file in my site's directories was the "active" one, but I found where Paulae asked that LAST month and J'Dad already answered -- the system does work!