Rewrite Rules Location

The Rewrites Rules Location feature in WP Ghost ensures that rewrite rules critical for the plugin’s functionality remain intact, even when other plugins attempt to modify or remove custom rules from the .htaccess file.

This tutorial guides you through enabling this option to improve compatibility and security.

Why Use Rewrites Rules Location?

Some WordPress plugins may overwrite or remove custom rules in the .htaccess file, especially if the file is writable. This can break custom paths and disrupt site functionality.

WP Ghost adds its rewrite rules directly within the default WordPress rewrite rules block by enabling the Add Rewrites in the WordPress Section option. These are placed between the comments:

# BEGIN WordPress
# END WordPress

This approach reduces the likelihood of other plugins’ removal of rules and maintains compatibility.

How to Use Rewrites Rules Location in WP Ghost

Add Rewrites in WordPress Rules Section

  1. Go to WP Ghost > Advanced > Compatibility.
  2. Switch on the Add Rewrites in WordPress Rules Section option to add the WP Ghost rewrite rules inside the WordPress rewrite rules section.
  3. Click the Save button to apply the changes.
Add Rewrites in WordPress Rules Section

Note! The rewrite rules will be automatically deleted on plugin deactivation.