If you don’t want WordPress to overwrite your changes in .htaccess file, then make sure that you write your changes outside of the WordPress comment block, that is, either before or after this:
# BEGIN WordPress
...
# END WordPress
Think of this area as WordPress’ territory. Anything within this block, will be overwritten by WordPress once it has to make any changes to .htaccess.
This is what you can do after the WordPress comment block:
# BEGIN WordPress
...
# END WordPress
<IfModule mod_rewrite.c>
# Write your rewrite rules here.
</IfModule>
Related Posts:
- Rewrite rule to load images from production does nothing
- WordPress rewrite rules don’t need ^?
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- Pretty URL via Rewrite
- Can’t get pretty permalinks to work without index.php
- How to create custom URL routes?
- Masking wp-content/themes/name/images to just images directory using htaccess
- How to add custom rewrite rule to .htaccess?
- How to change default page slug?
- SEO Friendly URLs for my plugin categories
- Mod_rewrite delete parameter in 301 Redirect
- Custom rewrite rules are sending everything to index.php
- WordPress keeps writing rewrite rules to .htaccess
- WordPress Rewrite
- Dynamic URL, not a physical page within the database
- Need to make a php file inside theme accessible via url
- Evaluating a external rewrite rule before internal wordpress rewrite rule
- Custom rewrite rule
- hard flush_rewrite_rules() not regenerating .htaccess
- Map alt domain to specific section of website w/o MU
- Rewrite Rules Are Redirecting and Not Passing VARs
- Adding rewrite rules directly to .htaccess file
- Custom rewrite not working
- Url Rewriting a dynamic wordpress page
- My WP_options db rewrite_rules Does Not Work
- Disable Pagination on Pages
- WP is ignoring .htaccess rewritten URL
- a one-off rewrite rule
- .htaccess rewrite
- Rewrite wp-login.php URLS to static pages?
- Change htaccess to redirect to index.php in subfolder
- Rewrite custom post type URL parameters
- How to remove wordpress directory slash
- Changed pagination URLS to use p= instead of paged=
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- URL Rewriting for PHP script on an image URL
- Change pagination url format
- Custom Rewrite rule to captured post (rewrite rule to rewrite rule)
- Map secondary domain to other’s virtual subfolder
- URL rewriting with custom user meta “/%shop_name%/gallery/%gallery%”
- WordPress keeps writing rewrite rules to .htaccess
- Customise particular RSS permalink
- RSS feed rewrite matching wrong rule
- Localize URL bases
- How can I create custom URL routes?
- Rewrite specific action url
- force www rewrite if wordpress put in a folder
- Rewrite rule that wp-login.php?action=register is left alone
- How to change an existing wordpress page rewrite rule?
- ModRewrite not working properly
- Migration from old CMS to WordPress 301 redirection rules?
- Custom Rewrite for Profiles
- Additional .htaccess rules based on wp page
- What is the proper way to use add_rewrite_rule to remove the (question mark)?
- help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]
- How to redirect a virtual page (e.g. /blog) to the home page?
- Add rewrite endpoint and .htaccess
- Rewrite Page Parameters
- WP-Include rewrite directory
- Is it possible to use the same slug structure for a taxonomy and for some pages?
- web.config conflict on IIS
- Passing parameters to a custom page template using clean urls
- add_rewrite_rule: $matches var not replaced by captured value
- How-to add rewrite rules to point the uploads folder to a subdomain
- How to map permalinks with accented letters to sanitized slugs?
- add_rewrite_rule not working for page var
- Adding the amp url prefix to the beginning
- Tricky URL rewrite with custom values in url
- Add rewrite rule to call front-page.php?
- Having trouble with using add_rewrite_rule and pagination
- Issue with using .htaccess to redirect feedburner feed
- Rewriting URLs in WordPress
- add_rewrite_rule() to route to file other than index.php
- ‘rewrite_rules_array’ or ‘generate_rewrite_rules’ for adding custom rewrite rules?
- Need help with simple rewrite rule (shouldn’t this be easy?)
- How to add a custom redirect rule for Post as subdomains?
- How to preserve the query string while using add_rewrite_rule and default public query vars
- “View post” leads to odd URL
- How to use add_rewrite_rule in subdomain
- Rewrite the default post object’s permalink
- Enpoint Not Found in Rewrite Tag Permalink
- ReWrite rule for files of a previously standalone blog moved to network
- Best way to trigger rewrite rules
- Trouble with question mark in rewrite rule
- Redirect htaccess [closed]
- Use URI suffix as parameter and ignore when resolving page
- Why wordpress rewrite my custom URL?
- Rewrite rule regex help required
- Redirect empty search to another page
- Rewrite dynamic URLs as pretty URLs in WordPress functions.php (add_rewrite_rule) – what’s wrong with my code?
- WordPress URL redirect and replace ? question mark
- Custom taxonomy Rewrite Rule
- I want to add one extra field to my URLs, I’m using Rewrite functions but it doesn’t work
- .htaccess RewriteRule to include post type and taxonomy
- Font Page overrides rewrites
- rewrite rule for home/index page
- Stop wordpress to redirecting home page if no page found
- URL Rewriting in WordPress
- Wrong rewrite rules
- How to write ReWrite Rule to cut URL?