Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
Exactly what I was looking for; thanks! –  dSquared Nov 1 '12 at 23:27
add comment

No, normaly onyl if you change the permalink structure. Often is a plugin the problem. But use a FTP tool or SSH and change the rights of the .htaccess file, that scritps dont change the data; like 644.

share|improve this answer
    
+1 on the 644 for the plugins. –  dSquared Nov 1 '12 at 23:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.