Wordpress更高效的HTACCESS/modu重写
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Wordpress更高效的HTACCESS/modu重写相关的知识,希望对你有一定的参考价值。
A member of Wordpress community says: I placed this code on my site and it instantly cut my page load times from 4-8 seconds per page (and typically on the high end of that) down to 1-3 seconds per page and EVERYTHING on my site works as it did before. I have yet to find a problem with anything related to the change. It was a HUGE WordPress Performance improvement... and it didn't require me adding yet another plugin like WP Cache or WP Super Cache and inheriting the various problems that using those entail.
# 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|css|js|ico)$ [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
以上是关于Wordpress更高效的HTACCESS/modu重写的主要内容,如果未能解决你的问题,请参考以下文章
使用 PHP 和 .htaccess (mod_rewrite) 管理 slug
htaccess - mod_rewrite 将虚拟目录或文件作为参数传回 index.php?