Title: Plugin overwrites htacess
Last modified: November 3, 2017

---

# Plugin overwrites htacess

 *  Resolved [testarn](https://wordpress.org/support/users/testarn/)
 * (@testarn)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/plugin-overwrites-htacess/)
 * Hi!
 * I used to have this code in my htacess file that redirects all urls to www since
   my website use www.
 *     ```
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{HTTP_HOST} ^domain.com [NC]
       RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 * However when i´m using your plugin to change the url with a parent my htacess
   file is overwritten? and now my site is using both?
 * [http://domain.com](http://domain.com)
    [http://www.domain.com](http://www.domain.com)
 * They are 2 different sites now? and i´m only logged in as an admin on the www
   one.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/plugin-overwrites-htacess/#post-9650532)
 * Hi [@testarn](https://wordpress.org/support/users/testarn/),
 * that is strange, because my plugin does not use rewrite rules and does not modify.
   htaccess file (there is no need to do this). The custom URIs are detected during
   pageload (when WordPress PHP functions are executed, with “parse_request” hook),
   after .htaccess rewrite rules are parsed (they are precedent to any PHP scripts).
 * I guess that you probably accidentally flushed the rewrite rules on “Permalinks”
   admin page:
    /wp-admin/options-permalink.php
 * A part of .htaccess code between `# BEGIN WordPress` and `# END WordPress` is
   restored to default setting after “Save changes” button is clicked.
 * You should separate your code from the WordPress rewrite rules to avoid overwriting
   your custom rewrite rules:
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteCond %{HTTP_HOST} ^example.com [NC]
       RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
       </IfModule>
   
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       # END WordPress
       ```
   
 * Regards,
    Maciej
 *  Thread Starter [testarn](https://wordpress.org/support/users/testarn/)
 * (@testarn)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/plugin-overwrites-htacess/#post-9652778)
 * Thanks, solved! 🙂
 *  [questiononly](https://wordpress.org/support/users/questiononly/)
 * (@questiononly)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/plugin-overwrites-htacess/#post-9749085)
 * I actually am having similar issue with the plugin, but my case is a bit different.
 * 1. I set up my domain (during WP installation) to use [http://www](http://www)
   version
    2. I work on the domain set up all things and everything is fine 3. 
   I install the plugin, just to manage & edit 1-2 permalinks of Pages 4. After 
   that, version [http://domain.com](http://domain.com) loads and doesn’t re-direct
   to [http://www.domain.com](http://www.domain.com)
 * Does it mean I need to use htaccess redirect in such case? The script seems to
   ignore what’s used in WordPress Address (URL) and Site Address (URL)
 * I checked and disabling the plugin makes everything work again, but that’s not
   the point obviously. 🙂
 * What do you suggest in such case?
    -  This reply was modified 8 years, 5 months ago by [questiononly](https://wordpress.org/support/users/questiononly/).
    -  This reply was modified 8 years, 5 months ago by [questiononly](https://wordpress.org/support/users/questiononly/).
 *  Plugin Author [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * (@mbis)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/plugin-overwrites-htacess/#post-9749207)
 * Hi [@questiononly](https://wordpress.org/support/users/questiononly/)
 * could you contact me via email [contact@maciejbis.net](https://wordpress.org/support/topic/plugin-overwrites-htacess/contact@maciejbis.net?output_format=md).
 * Regards,
    Maciej

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Plugin overwrites htacess’ is closed to new replies.

 * ![](https://ps.w.org/permalink-manager/assets/icon.svg?rev=2625166)
 * [Permalink Manager Lite](https://wordpress.org/plugins/permalink-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/permalink-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/permalink-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/permalink-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/permalink-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/permalink-manager/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Maciej Bis](https://wordpress.org/support/users/mbis/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/plugin-overwrites-htacess/#post-9749207)
 * Status: resolved