#23491 closed enhancement (fixed)
Add hook to insert_with_markers() so theme/plugin authors can prevent writing to .htaccess
Reported by: | alimony | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Rewrite Rules | Keywords: | has-patch |
Focuses: | Cc: |
Description
If not using .htaccess to rewrite, but instead keeping those settings in an Apache config file, it would be nice if writing the .htaccess file could be prevented by hooking into the function that does that (e.g. returning false or something like that).
Why? If the Apache option AllowOverride is turned off (which it should be for performance reasons, if not using any .htaccess files) the file won't ever be read. But still having it around (except cluttering) can possibly confuse someone having access to the server, seeing the file and thinking it actually controls anything. Especially since most WordPress support threads on the Internet assumes that an .htaccess file is used for rewrite rules.
One solution is to keep an empty, non-writable .htaccess file, optionally having a comment in it saying it's unused, but getting rid of the file altogether would be much cleaner. Also, it can still happen that someone accidentally changes the file permission, and someone else (or the same person) saves permalink options, saving a new .htaccess file, having created the possibility of confusion once again.
Attachments (2)
Change History (11)
#1
@
11 years ago
- Keywords has-patch added
23491.diff introduces a filter flush_rules_hard
that enables one to skip the creation of a .htaccess
file or IIS file. This comes in handy not only for those managing configurations separately, but for Nginx or other web servers as well where the .htaccess
file becomes just clutter.
#2
@
11 years ago
- Keywords commit added
- Milestone changed from Awaiting Review to 3.7
My take is 23491.2.diff. Thoughts?
#4
@
11 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 25328:
#5
@
11 years ago
- Keywords needs-docs added; commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
This filter needs a docblock per inline documentation standards
Introduces filter
flush_rules_hard