Title: Disable .htaccess File Creation in WP Statistics to Prevent Unnecessary Costs
Last modified: October 16, 2024

---

# Disable .htaccess File Creation in WP Statistics to Prevent Unnecessary Costs

 *  Resolved [chrillep](https://wordpress.org/support/users/chrillep/)
 * (@chrillep)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/disable-htaccess-file-creation-in-wp-statistics-to-prevent-unnecessary-costs/)
 * As a **WordPress administrator**, I want to **have the ability to disable the
   creation of .htaccess files by the WP Statistics plugin**, so that **I can prevent
   unnecessary costs associated with S3 storage caused by the repeated creation 
   of this file**. Additional information
 * Currently, the WP Statistics plugin attempts to create a `.htaccess` file to 
   restrict public access to certain directories. This functionality leads to increased
   costs due to the repetitive creation of the `.htaccess` file, impacting users
   regardless of whether they are using Apache or Nginx.
 * To accommodate all users, it would be beneficial to implement a way to disable
   this functionality. Possible options include:
    - **A new setting** in the WP Statistics settings page to enable or disable 
      the creation of the `.htaccess` file.
    - **A WordPress hook** that allows developers to programmatically disable the
      creation of the `.htaccess` file.
    - **An environment variable** that can be set to control this behavior without
      modifying the code directly.
 * Acceptance criteria
    - A method is available for users to disable the creation of the `.htaccess`
      file.
    - The existing functionality for users who need the `.htaccess` file remains
      unchanged.
    - Clear documentation is provided on how to use the new functionality.
 * How To Test
    1. Go to the WP Statistics settings page.
    2. Look for the option to disable `.htaccess` file creation.
    3. Change the setting to “disabled” and verify the behavior.
    4. Test the hook and environment variable to ensure they function as intended.
    5. Monitor the number of `.htaccess` files created in the specified directory before
       and after the change.
 * References
    1. [S3 Uploads GitHub Issue](https://github.com/humanmade/S3-Uploads/issues)
    2. [https://github.com/wp-statistics/wp-statistics/issues/569](https://github.com/wp-statistics/wp-statistics/issues/569)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdisable-htaccess-file-creation-in-wp-statistics-to-prevent-unnecessary-costs%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/disable-htaccess-file-creation-in-wp-statistics-to-prevent-unnecessary-costs/#post-18079170)
 * Hi [@chrillep](https://wordpress.org/support/users/chrillep/),
 * Thank you for bringing this into our attention!
 * We have implemented a filter ([this commit](https://github.com/wp-statistics/wp-statistics/commit/a6a5bfcac0b60dbfbdbf79fa389baf5c944fd4ce))
   so that the users can disable the creation of .htaccess file. This filter is 
   currently available in the development version of the plugin, and it will be 
   included in an upcoming release as well.
 * You can check out the development version [here](https://github.com/wp-statistics/wp-statistics/tree/development).
 * Please check our documentation at [https://wp-statistics.com/resources/disable-the-creation-of-htaccess-file-for-wp-statistics-upload-directory/](https://wp-statistics.com/resources/disable-the-creation-of-htaccess-file-for-wp-statistics-upload-directory/)
   to learn more.
 * Thank you for your continued support!
 * Regards

Viewing 1 replies (of 1 total)

The topic ‘Disable .htaccess File Creation in WP Statistics to Prevent Unnecessary
Costs’ is closed to new replies.

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

## Tags

 * [apache](https://wordpress.org/support/topic-tag/apache/)
 * [feature request](https://wordpress.org/support/topic-tag/feature-request/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [nginx](https://wordpress.org/support/topic-tag/nginx/)
 * [performance](https://wordpress.org/support/topic-tag/performance/)
 * [plugin settings](https://wordpress.org/support/topic-tag/plugin-settings/)
 * [WordPress](https://wordpress.org/support/topic-tag/wordpress/)

 * 1 reply
 * 2 participants
 * Last reply from: [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/disable-htaccess-file-creation-in-wp-statistics-to-prevent-unnecessary-costs/#post-18079170)
 * Status: resolved