I am not sure why this happens, but you can stop all write access to your .htaccess with a simple filter:
add_filter( 'flush_rewrite_rules_hard', '__return_false' );
Neither WordPress nor any plugins calling flush_rewrite_rules()
will write something into the file now. Other methods to access and change the file will still work, for example insert_with_markers()
.
Related Posts:
- How to add custom rewrite rule to .htaccess?
- SEO Friendly URLs for my plugin categories
- Custom rewrite rules are sending everything to index.php
- WordPress Rewrite
- Dynamic URL, not a physical page within the database
- Custom rewrite rule
- hard flush_rewrite_rules() not regenerating .htaccess
- Map alt domain to specific section of website w/o MU
- Rewrite rule to load images from production does nothing
- WordPress rewrite rules don’t need ^?
- Url Rewriting a dynamic wordpress page
- My WP_options db rewrite_rules Does Not Work
- Disable Pagination on Pages
- .htaccess rewrite
- Changed pagination URLS to use p= instead of paged=
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- WordPress keeps writing rewrite rules to .htaccess
- Customise particular RSS permalink
- RSS feed rewrite matching wrong rule
- Rewrite specific action url
- How do I make WordPress revise an .htaccess file a certain way?
- Rewrite rule that wp-login.php?action=register is left alone
- Pretty URL via Rewrite
- Migration from old CMS to WordPress 301 redirection rules?
- Additional .htaccess rules based on wp page
- What is the proper way to use add_rewrite_rule to remove the (question mark)?
- Can’t get pretty permalinks to work without index.php
- Rewrite Page Parameters
- WP-Include rewrite directory
- How do you create a “virtual” page in WordPress
- Preserving $_GET parameter while using custom Rewrite Rule
- Taxonomy rewrite question
- How do I remove a word from a url in WordPress using .htaccess?
- Rewrite rules in .htaccess get overwritten?
- Getting add_rewrite_rule and add_rewrite_tag to work
- Rewrite Rule for Post “Subpage”, with pagination
- unexpected problem in url rewrite
- Need to make a php file inside theme accessible via url
- WP Rewrite the last two parts of the URL
- Rewrite loading custom template file but is_home() returns true, and there’s no 404
- Rewrite rule for admin-ajax.php
- WordPress redirection to get url friendly
- Access $_POST data after redirect
- Change Query String to pretty permalink
- How to add a custom redirect rule for subdomains?
- Remove special characters in a URL
- Add query string to url and display it as normal url part /folder/
- Is it possible to remove feeds from rewrites?
- Alias ‘wp-content’ directory to something shorter (framework?)
- Flush Rewrite Rules on init or rest_api_init?
- WordPress .htaccess – route other URLs to another app
- How to properly rewrite url by custom var
- url rewrite parsing a custom url parameter not working
- How to add custom variable in url without redirect?
- Using category slug in add_rewrite rule
- add_rewrite_rule ignoring other params than the “p” param
- How to catch Rewrite rules then display a specific post?
- Adding two rewrite rules
- Load an url with minimal/no DB queries
- Auto generate rewrite rules for multiple taxonomies
- Change htaccess to redirect to index.php in subfolder
- Cannot access wp-admin without trailing slash – .htaccess configuration for WordPress behind a nginx proxy
- Wildcard forward all posts and pages with few exceptions
- Help with Rewrite Rule for Custom Post Type with Query String
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- URL Rewriting for PHP script on an image URL
- Create Dynamic SEO Friendly URL for Virtual Page
- add_rewrite_rule with query variables
- Rewrite query string to path
- Rewrite API -Adding a parameter before the slug
- Rewriting a subdomain page on one WordPress installation to a parent domain on another
- Rewrites rules disappear after a while
- Rewrite vs Redirect from ?p={ID}
- Adding a rewrite rule to page that has no fixed variables and pagination
- Flush rewrite rules on option update with Settings API
- Having WordPress control only certain pages with .htaccess?
- Localize URL bases
- Help with a custom rewrite
- Using URL rewrite to add custom URL for custom post type
- 301 Rewriting htaccess
- Proper way to set up rewrite with Wp
- Rewrite custom taxonomy slug – but only parent items
- Exclude subfolder in WordPress permalink
- wordpress path generation from rewrite rule
- Rewrite WordPress Url from root to subfolder without moving files
- WordPress pagination broken for page 2,3 with custom permalink. Redirects to baseurl
- Help with .htaccess setup to hide WordPress Directory
- Ugly URLs when there’s pagination
- Why is there a 404 on page 2+ for my search page?
- URL Rewrite and Archive Template Files – Post Type vs. Taxonomy
- .htaccess RewriteBase equivalent for WordPress – Passing a URL as a variable without getting a 404
- Change Admin URL
- URL Rewrite for CPT single posts
- Using add_rewrite_tag to create urls for page sections
- Rewriting WordPress URLs
- How to rename the WordPress wp-login.php running on IIS6?
- Use add_rewrite_rule to change subpage url
- Rewrite rule to simulate page hierarchy results in 404
- add_rewrite_rule not working with custom variables
- add_rewrite_rule doesn’t work when trying to add a new parameter at the end of URL