Title: apache module write breaks htaccess file
Last modified: August 31, 2016

---

# apache module write breaks htaccess file

 *  [zachary.lv](https://wordpress.org/support/users/zacharylv/)
 * (@zacharylv)
 * [10 years ago](https://wordpress.org/support/topic/apache-module-write-breaks-htaccess-file/)
 * I manage a few WordPress subdirectory-based multisites. I use both the WordPress
   and Apache modules to create redirects for various purposes.
 * For the last several versions of Redirection I’ve been having an issue using 
   the htaccess file writing feature of the apache module.
 * I have between 75-250 redirections for these networks. When I create a new redirect
   in the apache module the Redirection plugin writes new rules to my htaccess file,
   but rather than creating a single block of rewrite rules, the plugin writes the
   opening comments and IfModule tag correctly, but then the long list of rewrite
   rules are broken up inconsistently by a comment listing the date Redirection 
   updated the htaccess file and a closing IfModule tag over and over again.
 * So the resulting htaccess file has an opening IfModule and then changes 200 lines
   of rewrite rules to 8000+ lines of duplicated rewrite rules and hundreds of closing
   IfModule tags.
 * If i delete all the rewrite rules and then add a redirect Redirection creates
   a perfect set of rewrite rules, but the next rewrite rule I add causes the problem
   all over again.
 * [https://wordpress.org/plugins/redirection/](https://wordpress.org/plugins/redirection/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/apache-module-write-breaks-htaccess-file/#post-7446561)
 * If you don’t mind the data being public could you add the htaccess file and source
   URLs in a new issue here:
 * [https://github.com/johngodley/redirection/issues](https://github.com/johngodley/redirection/issues)
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘apache module write breaks htaccess file’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [John Godley](https://wordpress.org/support/users/johnny5/)
 * Last activity: [9 years, 12 months ago](https://wordpress.org/support/topic/apache-module-write-breaks-htaccess-file/#post-7446561)
 * Status: not resolved