Problem/Motivation
As most seasoned Drupal users know, there are many possible pitfalls when beginning to work with Drupal. As a new user, you might edit the code in core, put contrib modules in the wrong folder, or in both web/modules as well as web/core/modules folder, etc. Another potential pitfall is editing .htaccess, most commonly to redirect from the www to the non-www domain, or vice versa.
Whereas it is possible to edit .htaccess, it should not be recommended, since it is very important to allow the .htaccess file to be updated, if there is a security update.
If or when the .htaccess file has been over-written after an update, figuring out why a web site, or something else stopped working can be quite difficult.
Proposed resolution
To avoid this situation, it would help to change the mental image of the .htaccess file from "Here is a configurable file, and how to do it", to more of a "It's possible, but not recommended".
Remaining tasks
- Add warning in the
.htaccessfile to not edit it, explaining why. - Document alternative solutions on setting web root folder and redirecting, and link to them. For example:
- Server-level (Apache, Nginx, etc.)
- Redirect to HTTPS and www/non-www with settings.php
- More?
Comments
Comment #2
cilefen commentedSite owners should patch .htaccess.