You can give the read-only rights to .htaccess to prevent it from the modifications or removal.
$cd <your website directory>
$chmod 400 .htaccess
Related Posts:
- Serve apache 404 for missing assets rather then wp 404 template WP_Rewrites
- WordPress site displaying 404 for any page apart from index
- HTAccess stops me from accessing WordPress Dashboard links
- Site searches by Python for non-existent assets
- WordPress 404 on Subdomain
- WordPress overrides custom 404 page with it’s own
- Fixing custom 404 pages broken by WordPress in a subdirectory
- Override 404 page with htaccess
- WordPress category with 404 error
- 404 error Additionally 403 Forbidden error on a URL
- My Homepage Suddenly Disappeared and I Can’t Get It Back
- “Oops.” error on an html file directly uploaded to a subdirectory of my WordPress site
- htaccess redirects invalid request to home page not 404
- Downloading zip or tar.gz inside WordPress installation?
- Clicking PUBLISH Now Redirects to 404 PAGE NOT FOUND
- After changing permalink, getting 404 for one particular category
- Installing wordpress on subdirectory 2 levels down
- Cannot Override WordPress 404 for a Sub-Directory
- Issue after changing permalink structure [duplicate]
- Why ‘Authorization Required’ is coming on wordpress login
- Home page returns 404
- Permalinks not working on debian with OVH
- adding rewrite rules in .htaccess
- Plugin to edit htaccess file
- Permalinks not working on second wordpress installed in a subdirect
- Change wp-content without changing the name of the folder
- Using “wordpress_logged_in” to restrict direct access to uploads folder in 2021
- Temporary .htaccess blocking is disabling WP Crons from running?
- .htaccess redirects disappeared after re-saving permalinks
- How have I misconfigured basic auth for my wordpress site?
- WordPress best solution shared theme for consumers and businesses (two url’s one instaltion)
- Redirect main domain to subdirectory
- WordPress multilingual website domain and folders
- Attach to wp-login.php and xmlrpc.php
- Removing code added to htaccess with insert_with_markers
- WordPress blocking/preventing viewing of .cgi file in subdirectory [closed]
- XMLRPC filtering through htaccess not working
- Corrupt .htaccess file
- Cache policy not updated according to PageSpeed
- What’s the opposite of required valid user in .htaccess authentication
- How can i redirect one url to another url using .htaccess or add_rewrite_rule
- When is it necessary to have Header unset Vary in .htaccess
- WordPress 404 in development area
- Redirect http to https does not work on subdir where another instance of WordPress installed
- redirect the homepage using .htaccess outside of WordPress
- Https Redirect infinite loop in Mobile browsers
- 403 error on admin login page
- Custom Permalink
- Redirect an old link to new site homepage [closed]
- .htaccess rewriting old RSS feed URL to WordPress feed URL
- How can I set Cache TTL for woff and woff2 font files with htaccess?
- htaccess working on local server but not on live server
- How can I fix the redirect chain after implementing ssl on wordpress?
- How to write .htaccess so that https is on for subpages only but not the home page
- How do I configure wordpress structure for development using git and composer
- How to create a redirect in the .htaccess file, with 2 exceptions
- Custom rewrite rule, url returning 404
- mod_rewrite doesn’t work as I want even with JSON API Plugin disabled
- How to turn this .htaccess rule into a dynamic rule with add_rewrite_rule, et al?
- Disable directory browsing of uploads folder
- Cannot login to WordPress site after changing .htaccess for security purposes
- Local PC cache stays filled with old WordPress Site data
- How to have a custom URI path for specific page template
- .htaccess Non-‘www’ to ‘www’ Subdomain Redirection Only Works for Homepage
- WordPress JSON API restrict to specific domain
- Where to put W3 Total Cache rewrite rules in .htaccess? [closed]
- How to redirect an old page url to the homepage
- Rewrite Rules not redirecting rewrite
- How do i allow access to a single file in my root directory? [closed]
- 404 redirect based on url
- Selectively Disabling PHP via .htaccess in Root Directory
- What’s the best way to manage a lot of 301 redirects in WordPress?
- old permalinks not found
- Shared hosting, multiple sites, can’t log in to WP due to .htaccess redirection
- What causes 404 errors that forces you to rebuild a .htaccess file?
- How to set up MS Exchange Autodiscover alongside WordPress
- Xampp is not loading media
- PHP application in sub directory keeps redirecting to main site
- Woocommerce posts and products links works only once and then get 404 error
- Blocking wp-login in HTACCESS has also blocked password protected pages
- execute cron jobs when .htaccess login protected?
- Redirect WordPress site to a landing (construction) page using htaccess, with access to /wp-admin and /invoice
- Pages in wp-admin is not found 404
- htaccess redirect to path
- change URIs of migrated site
- htaccess- to hide subdirectory slug only from the post
- Subfolder renaming
- Steps for WordPress over SSL
- Fixing Access-Control-Allow-Origin (CORS origin) for multiple subdomains
- Targeting .htaccess file with file_put_contents
- Redirect Loop in Regex Moving to HTTPS
- insert_with_markers() WordPress & htaccess help
- WordPress login bug. Need an emergency solution
- .htaccess and virtual host configuration for WP in its own directory
- Cannot find webarh/malware redirect infection that only shows on Chrome
- Some images 404
- Debug errors for “Destination directory for file streaming does not exist or is not writable”
- WordPress redirection
- Post pages are redirecting to the 404 page in wordpress
- Browser Caching .htaccess