<p>I have seen alot of threads about this issue, but unfortunately, I cannot get my head around my issue. From all the threads I have been reading, it seems that directory structure has changed in the latest release of stable wordpress.</p>

<p>I am trying to achieve multiple things out of which:</p>

<ol>
<li><p>Allowing wordpress to generate the default config of htaccess. When I go to the permalinks settings, it asking me to add a piece of mod_rewrite code to htaccess as it has no write permission.</p></li>
<li><p>I am trying to use certain plugins such as wp-rocket, all in wordpress security and firewall, but all these need to have access to htaccess to write certain rules.</p></li>
<li><p>I am trying to also find the script to restarts, status of apache in this structure /opt/bitnami/ctlscript.sh restart but the sh script is no where to be found.</p></li>
</ol>

<p>Can someone please guide me how to achieve the above please as I have been days researching and trying multiple things. I am using helm to install all this in a kubernetes environment on google cloud.</p>

<p>Much appreciated many thanks!</p>

Jojo
<p>Note that Helm charts work in a different way than Bitnami stacks such as the Bitnami WordPress stack, so there are certain things such as restarting a service which are conceptually different if you are using Helm charts or stacks.</p>

<p>Keeping this in mind, I'm going to reply to your questions below:</p>

<blockquote>
  <ol>
  <li>Allowing wordpress to generate the default config of htaccess. When I go to the permalinks settings, it asking me to add a piece of mod_rewrite code to htaccess as it has no write permission.</li>
  <li>I am trying to use certain plugins such as wp-rocket, all in wordpress security and firewall, but all these need to have access to htaccess to write certain rules.</li>
  </ol>
</blockquote>

<p>Unfortunately the <code>.htaccess</code> file is not persisted between pods. However, you can workaround this by creating a <code>.htaccess</code> ConfigMap like described below:</p>

<p><a href="https://github.com/helm/charts/tree/master/stable/wordpress#disabling-htaccess" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/wordpress#disabling-htaccess</a></p>

<p>Once done, you can customize the file <code>/path/to/wordpress-htaccess.conf</code> and add all necessary directives on your side.</p>

<p>But keep in mind this means WordPress won't be able to add them automatically on its side, you will need to add them on yours.</p>

<blockquote>
  <ol start="3">
  <li>I am trying to also find the script to restarts, status of apache in this structure /opt/bitnami/ctlscript.sh restart but the sh script is no where to be found.</li>
  </ol>
</blockquote>

<p>Bitnami Helm installs do not use <code>ctlscript.sh</code> for managing services. Instead, the recommended way to restart WordPress in Kubernetes (or any Kubernetes service) is by deleting the pod.</p>

<p>Then, because it is launched inside a deployment, the pod will be recreated with the persisted configuration (same uploads, themes, database configuration, etc.).</p>
