LAMP-Update deletes .htaccess

I have noticed that after an update, all changes to the .htaccess file have disappeared. This is particularly unfortunate because it is the only way I can redirect from https://mydomain.tld to https://www.mydomain.tld.

I had suspected this before, but only now have I looked into it specifically.

I also suspect the same problem with WordPress-App.

where do you drop you .htaccess please

1 Like

I can’t reproduce.

I installed lamp 1.0.15.

Then I changed the /app/.htaccess…

[lamp1@node state]$ podman exec -ti apache2-app bash
root@lamp:/# nano app/.htaccess

…and added a php option so the /app/.htaccess looked like the following:

# write your custom settings, uncomment or add your directives
# php_value max_execution_time 600
# php_value max_input_time 600
# php_value memory_limit 512M

# This is a test to set max input time to 600
php_value max_input_time 600

After updating to most recent lamp 1.1.0 the file with content was still there:

[lamp1@node state]$ podman exec -ti apache2-app cat app/.htaccess
# write your custom settings, uncomment or add your directives
# php_value max_execution_time 600
# php_value max_input_time 600
# php_value memory_limit 512M

# This is a test to set max input time to 600
php_value max_input_time 600
1 Like

yes app is a volume so all the content should be preserved

1 Like

I had to manually add the redirection again on all my servers.

Definitely.

Is it possible that some Wordpress or other plugin rewrites the .htaccess file?

See for example How to Stop WordPress from Overwriting the .htaccess File

1 Like

Thank you for pointing that out. I will look into it.

2 Likes