Looking for a better way to track, manage, and/or customize .htaccess
.htaccess can be used to implement a multitude of custom, Apache configurations. But, the default, webroot .htaccess file in this git repo will overwrite any local, customized .htaccess during a git pull update.
So, people should have the option to maintain a custom .htaccess file.
As per issue #1834, I propose something like 1 of the 2 following solutions:
Solution #1: To ONLY create custom URL rewriting rules
- Add a "RewriteOptions InheritBefore" directive to the mod_rewrite section in the existing repo .htaccess file that:
- If Hubzilla should run in a virtual host's webroot directory, requires the virtual host's default web root directory to be changed to a custom directory beneath the previous, default webroot directory
- Requires Hubzilla installation in a default webroot's subdirectory or, as indicated above, a custom webroot directory
- Enables a custom .htaccess file in the Hubzilla installation's parent directory whose rewrite rules supersede Hubzilla's core rewrite rules
- Requires NO mod_rewrite directives in core Apache server config files that could, in some cases, potentially and detrimentally supersede Hubzilla's core rewrite rules (maybe a deal breaker?? -- I don't know if this is common)
Solution #2
- Rename the existing repo .htaccess file to, e.g., .htaccess.default
- Create a new installation (PHP or Bash?) script that:
- Runs git pull
- Checks for the existence of .htaccess in the local repo copy
- If no .htaccess exists, then copy .htaccess.default to a new .htaccess file
- If .htaccess does exist and is identical to .htaccess.default, do nothing
- If .htaccess does exist and is not identical to .htaccess.default, log a message in php.out?? (or elsewhere) saying that new .htaccess updates are available in .htaccess.default