Title: Stop changing WordPress rules!
Last modified: December 4, 2017

---

# Stop changing WordPress rules!

 *  Resolved [greencode](https://wordpress.org/support/users/greencode/)
 * (@greencode)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/stop-changing-wordpress-rules/)
 * I have WordPress in it’s own directory as outlined here [https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory](https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory)(
   Method 1).
 * The problem is whenever there’s an update for Wordfance it seemingly changes 
   the WordPress rewrite back to the original settings which in turn causes a 404
   Error on the site.
 * I have this set up on a few sites and the same happens with all.
 * Any ideas on how to stop this.

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

 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/stop-changing-wordpress-rules/#post-9757991)
 * Hi,
    I couldn’t manage to reproduce this issue at my end, here you are what exactly
   I did: – Installed WordPress and Wordfence version 6.3.21 on the root of my demo
   site. – I’ve followed this [guide](https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Method_I_.28Without_URL_change.29)
   precisely, method 1. – I configured the firewall and the “.htaccess” file that
   was modified was that one in the sub-directory folder. – I upgraded Wordfence
   to the latest stable version and neither the “.htaccess” file in the sub-directory
   nor that one in the root folder was modified.
 * Could you please let me know if I’m missing something?
 * Thanks.
 *  Thread Starter [greencode](https://wordpress.org/support/users/greencode/)
 * (@greencode)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/stop-changing-wordpress-rules/#post-9759686)
 * Hi. Thanks for replying. What I did was:
 * – Install WP in a subdirectory e.g. /site
    – Load up WP CMS and go to Settings
   > General and change the Site address to root e.g. [https://www.mysite.com](https://www.mysite.com)
   and the WordPress address should be [https://www.mysite.com/site](https://www.mysite.com/site)–
   Follow Method 1 to change the .htaccess file to:
 *     ```
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
       RewriteCond %{REQUEST_URI} !^/site/
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^(.*)$ /site/$1
       RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
       RewriteRule ^(/)?$ site/index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 * Thanks.
 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/stop-changing-wordpress-rules/#post-9764449)
 * In my opinion, that’s a different implementation than the one described in method
   1, I recommend following method 2 in your case as it includes URL changing.
 * I confirm that Wordfence never rewrite or delete any other code snippets in “.
   htaccess” files, the plugin only write or delete snippets wrapped by “# Wordfence
   WAF” and “# END Wordfence WAF” in both cases, but you might want to check when
   was this file recently modified and compare this timestamp with the Wordfence
   update time.
 * Thanks.

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

The topic ‘Stop changing WordPress rules!’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/stop-changing-wordpress-rules/#post-9764449)
 * Status: resolved