最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

permalinks - Does WordPress Change the .htaccess File When Updating?

programmeradmin1浏览0评论

I've just implemented a new WP website, replacing an older hardcoded HTML site. I will be adding 301 redirects in the .htaccess file to point the old URIs to the new WP Permalinks.

My questions is, as WP generates the .htaccess file initially (at least on my install it did) will WP overrite the .htaccess file when I update WP in the future?

Further to the above, is there any time, including the update as mentioned above, that WP may overwrite this file and if so is there a way to prevent that?

I've searched high and low and can't seem to find a straight answer.

Any help would be appreciated.

Thanks!

I've just implemented a new WP website, replacing an older hardcoded HTML site. I will be adding 301 redirects in the .htaccess file to point the old URIs to the new WP Permalinks.

My questions is, as WP generates the .htaccess file initially (at least on my install it did) will WP overrite the .htaccess file when I update WP in the future?

Further to the above, is there any time, including the update as mentioned above, that WP may overwrite this file and if so is there a way to prevent that?

I've searched high and low and can't seem to find a straight answer.

Any help would be appreciated.

Thanks!

Share Improve this question asked Nov 1, 2012 at 21:15 dSquareddSquared 2854 silver badges11 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 12

Generally speaking WordPress will update the .htaccess file any time you change the permalink structure. Many plugins will also update/modify the file as needed.

But the default structure of the .htaccess file allows you to lay it out in such a way that WordPress will not overwrite your custom entries.

WordPress will overwrite the entries between '# BEGIN WordPress' and '# END WordPress'. While most plugins will create their own begin and end tags and only update within those tags.

Simply put your custom entries outside of any custom tags/comments and they SHOULD be preserved when WP updates the file.

No, normally only if you change the permalink structure. Often a plugin is the problem. But you can use an FTP tool, or SSH, to change the access rights of the .htaccess file to something like 644, so that scripts don't change the data.

发布评论

评论列表(0)

  1. 暂无评论