Hello Ben,
Thank you for reaching out. The current version of Staatic makes it a bit tricky to add custom code to the .htaccess file. However, we’ve introduced new features to help with this. We’ve added two filter hooks: staatic_filesystem_apache_config and staatic_filesystem_nginx_config. These allow you to modify the .htaccess and nginx_rules.conf files before saving them.
To access these new features, you need to update to the latest development version of Staatic. Here’s how to do it:
- Go to the WordPress Plugin Directory.
- Find Staatic, click on Advanced View.
- Scroll down to Advanced Options.
- Choose Development Version and click Download.
- Install this new version.
For guidance on using these hooks, check out this example: staatic_filesystem_apache_config.php. You can add this code to your theme’s functions.php file, or as a new file in wp-content/mu-plugins (like staatic_filesystem_apache_config.php).
If you have any more questions or need help, feel free to ask.
