开发者

Best place / file to place rewrite_rules_array hook

Just wondering where the best place (file) to place the API hook rewrite_rules_arr开发者_JAVA技巧ay would be?

Cheers

Will


I think the best place for rewrite rules is the .htaccess file. The functions provided by WP just create this for you.

See http://articles.sitepoint.com/article/guide-url-rewriting to learn more about URL rewriting.

While abstraction is good (as in the WP rewrite functions), I think it is best to write your own rewrite rules in .htaccess to reduce problems when moving from one system to another. It is much easier to change one file then to find a function that is causing problems and change the code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜