.htaccess Editor (safe editing & backups)
Edit the root .htaccess from WordPress with automatic backups, validation, and Quick Snippets for common performance and security rules. Open SEO Rank Genius → Tools & Analytics and choose the .htaccess Editor tab (tab=htaccess-editor).
Before you start
Direct URL (bookmark-friendly): /wp-admin/admin.php?page=seo-link-genius_tools&tab=htaccess-editor. You need an administrator-capable account; treat this screen like production infrastructure—one malformed directive can return 500 errors for every request.
Utilities column
Select .htaccess Editor from the Utilities group in the tab rail.
Pattern: srg-mock-bar + dark srg-mock-wpbar + tab rail mirroring Tools & Analytics.
- Try changes on staging or during a low-traffic window when possible.
- Keep host panel or SFTP access ready—if the admin UI cannot load, you restore .htaccess at the filesystem level.
- Pair HTTP-layer fixes here with in-plugin redirect tools so you are not maintaining two conflicting rewrite stories.
.htaccess screen
The tab opens with a short feature description, an amber Caution banner, and three status chips: whether .htaccess exists, whether the file (or web root) is writable, and how many backups are on file. The main column is a monospace editor with Refresh (reload from disk) and Save Changes; the footer shows the absolute path and file size when the file is present.
Caution
Editing .htaccess can break your site. Test carefully; use FTP or backups if you lose access.
Status row + dark editor + footer path mirror the live tab-htaccess-editor.php layout.
Backup & restore
Each successful save creates a new backup before the file is written, tagged with a reason (for example “Manual edit”) and line count. The plugin keeps a rolling history (up to ten backups); files are stored under your uploads directory in a dedicated folder that is protected from direct web access.
- Preview — open a read-only view of a snapshot before you commit to restoring it.
- Restore — write that snapshot back to .htaccess and refresh the editor; another backup is created as part of the safe write path.
- Load into Editor (from the preview modal) — copy backup text into the textarea so you can merge changes manually, then save once you are satisfied.
srg-mock-metabox rows stand in for the sidebar Backup History list with preview and restore actions.
Common SEO rules (Quick Snippets)
The right column lists Quick Snippets. Clicking an item appends its block to the end of the editor (with spacing) if that snippet is not already detected—duplicates trigger a warning instead of silent repeats. Categories appear as security or performance labels in the product UI.
Shipped snippets include: Fix REST API 403 Errors, Enable GZIP Compression, Browser Caching Headers, Security Headers, Block XML-RPC, Protect wp-config.php, Disable Directory Browsing, and Force HTTPS. Use them to support Core Web Vitals (compression + caching), harden admin surfaces, and align TLS—while keeping granular redirect matrices in Rank Genius redirect tools rather than duplicating dozens of brittle rewrite lines.
Click-to-append workflow; categories match snippet metadata in code.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
…
</IfModule>
Safety checklist
Preserve WordPress core blocks
Keep existing # BEGIN WordPress / # END WordPress sections intact unless your host documented a migration. Custom rules usually belong above or below that block per host guidance—not randomly in the middle.
Match paired directives
Saves validate balanced <IfModule>, <Directory>, and <Files> tags. Asymmetric pairs block the write and flash an error rather than silently breaking production.
Test after saving
Load the homepage, a single post, and wp-login in a private window. CDN users should purge HTML edge cache so you are not seeing an older error page.
Troubleshooting
Most incidents map to filesystem permissions, failed validation, or environmental mismatch (Apache modules missing). Work through browser errors and the admin notices together—they often include the validator message verbatim.
Validator rejected my paste
Count opening/closing wrappers, then retry. Mixed encoding from Google Docs frequently introduces invisible characters—paste through a plain editor first.
Read-only installs mirror production hardening—fix permissions externally, then reload the tab.