Title: HTACCESS Autoptimize
Last modified: February 2, 2018

---

# HTACCESS Autoptimize

 *  Resolved [ceslad](https://wordpress.org/support/users/ceslad/)
 * (@ceslad)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/)
 * Hi.
    I noticed that autoptimize has a HTACCESS file created. It turns out that
   WordPress also has a HTACCESS (where I’ve put rules to take advantage of the 
   browser cache). Can there be two HTACCESS files inside the hosting?
 * Thanks
    -  This topic was modified 8 years, 4 months ago by [ceslad](https://wordpress.org/support/users/ceslad/).
    -  This topic was modified 8 years, 4 months ago by [ceslad](https://wordpress.org/support/users/ceslad/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-9929455)
 * > Can there be two HTACCESS files inside the hosting?
 * yes, apache will check each directory for a .htaccess and will apply rules found
   in one to that directory and child directories.
 * hope this clarifies,
    frank
 *  Thread Starter [ceslad](https://wordpress.org/support/users/ceslad/)
 * (@ceslad)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-9930180)
 * Can I remove the codes that are in the <HTACCESS> of the AUTOPTIMIZE and put 
   them in the <HTACCESS> of the WORDPRESS?
 * Another question:
 * Inside the WORDPRESS <HTACCESS>, I already have a code that I put with rules 
   to take advantage of the browser cache. I mean, in autopmitize there’s a <HTACCESS
   > with cache codes, and in WORDPRESS there are also cache codes.
    What do you
   think? Can I have a problem?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-9930635)
 * > Can I remove the codes that are in the <HTACCESS> of the AUTOPTIMIZE and put
   > them in the <HTACCESS> of the WORDPRESS?
 * you can, but AO will re-write them every time you clear the cache. you could 
   however create an (empty) ao htaccess template-file `wp-content/AO_htaccess_tmpl`
   in which case AO will use that one.
 * > Inside the WORDPRESS <HTACCESS>, I already have a code that I put with rules
   > to take advantage of the browser cache. I mean, in autopmitize there’s a <HTACCESS
   > > with cache codes, and in WORDPRESS there are also cache codes.
   >  What do you
   > think? Can I have a problem?
 * depends on what is in your own .htaccess, but problems would be unlikely 🙂
 * have a nice weekend,
    frank
 *  Thread Starter [ceslad](https://wordpress.org/support/users/ceslad/)
 * (@ceslad)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-9930731)
 * this is the code that is in wordpress htaccess:
 * #BEGIN cache
    <IfModule mod_expires.c> ExpiresActive On ExpiresDefault “access
   plus 1 month” ExpiresByType image/webp “access plus 1 month” ExpiresByType image/
   gif “access plus 1 month” ExpiresByType image/png “access plus 1 month” ExpiresByType
   image/jpg “access plus 1 month” ExpiresByType image/jpeg “access plus 1 month”
   ExpiresByType image/ico “access plus 3 month” ExpiresByType image/svg+xml “access
   plus 1 month” ExpiresByType text/css “access plus 1 month” ExpiresByType text/
   javascript “access plus 1 month” ExpiresByType text/html “access plus 1 month”
   ExpiresByType application/javascript “access plus 1 month” ExpiresByType application/
   x-javascript “access plus 1 month” </IfModule> #END cache
 * I did not understand. You tell me to create a folder inside <wp-content>? What
   name would I give to this folder? Can I put it in place of the <Cache> folder?
   Would it be this?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-9930754)
 * > this is the code that is in wordpress htaccess:
 * don’t see any obvious issues there.
 * > I did not understand. You tell me to create a folder inside <wp-content>? What
   > name would I give to this folder? Can I put it in place of the <Cache> folder?
   > Would it be this?
 * No, my point is you can create a **file** called `AO_htaccess_tmpl` in wp-content.
   if it is there AO will use the contents of that file for it’s own .htaccess.
 * frank
 *  [rjrobinson](https://wordpress.org/support/users/rjrobinson/)
 * (@rjrobinson)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-10007324)
 * I have a similar issue. My htaccess includes Expires headers, gzip and deflate
   commands. Do ANY of these serve an useful purpose if i’m using AO? If not, do
   I just delete them?
 * (Excellent plugin, by the way!)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-10007349)
 * > Do ANY of these serve an useful purpose if i’m using AO?
 * they do, actually, for all non-AO’ed resources, so I would leave them be 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘HTACCESS Autoptimize’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/htaccess-autoptimize/#post-10007349)
 * Status: resolved