Closed netzarbeiter closed 5 years ago
I think that's a quite common case @contao/developers. If the .htaccess only contains AddHandler
, I think we could add that, wdyt?
I don't think merging an .htaccess
file is a good idea. There is too much that could go wrong.
(That by the way is another reason why shipping that file is problematic / related disucssion: #58)
I would do it only if AddHandler
and only if AddHandler
is present. As soon as there's other content in there, I wouldn't do anything at all.
Yeah, that would be fine then, I guess. We have to be careful, though. If something in the lines we're adding affects this php setting (and if it's presence is neccessary by the hoster), the server might e.g. deliver unparsed PHP.
The AddHandler
case is just very, very common for virtual hosts, that's why I think that might be worth an exception.
I don't think merging an
.htaccess
file is a good idea. There is too much that could go wrong.
I fully agree with this. We must not mess with an existing .htacces
file!
If you don't want to mess with an existing .htaccess
, the Contao Manager should display a warning that the .htaccess
could not have been written and were they get it from.
maybe it´s possible to write .htaccess-contao
if another htaccess exist - it´s easier to copy one content to another htaccess...
As discussed in Mumble on August 30th, we want to check the existing .htaccess
file for
/^\s*RewriteRule\s/im
and if there is no match, we want to append the .htaccess content. Additionally, we want to provide a .htaccess.default
file, so people can look up what needs to be added.
Thank you @Toflar. 👍
Some Webhoster are adding a
.htaccess
with anAddHandler
in the web-folder if you change the PHP version.For example:
AddHandler application/x-httpd-php72 .php
Is it possible to merge the AddHandler during the creation of the
.htaccess
and overwrite the old version.While testing the new Contao Manager everything went well, expect updating the database (domain.com/contao/install), while the needed lines in the .htaccess were missing.