Comments (5)
It's literally the first line of code.
add_action('generate_rewrite_rules', __NAMESPACE__ . '\\ApacheServerConfig::init', -9999, 0);
There's not much else that I know of that I can do besides set it to the lowest priority like that so that it hopefully gets processed first.
I have noticed that sometimes it's not first, and I'm not sure why, but I also didn't care. WordPress only has rewrite rules, so this really isn't that big of a deal, imo.
If you want to give it a shot and send a PR, feel free.
from wp-h5bp-htaccess.
Will test at some point during the the next fortnight.
Thanks again.
from wp-h5bp-htaccess.
@QWp6t you might be able to use PHP_INT_MIN
if you want to make sure the priority is as low as possible.
add_action('generate_rewrite_rules', __NAMESPACE__ . '\\ApacheServerConfig::init', PHP_INT_MIN, 0);
from wp-h5bp-htaccess.
That's only for PHP 7.0+.
But it's not absolutely necessary to be the very first, so I'm not concerned about that.
from wp-h5bp-htaccess.
It is necessary to be first for some of the directives to be effectual.
.htaccess is read from top to bottom and directives are observed in read-order. Once the WordPress rewrites are reached, WordPress takes over for virtual files and directories that are managed by WP and thus applies WP PHP based rewrites.
For example, where we want to deny access to a file or directory, if WP kicks in before the .htaccess directive that blocks access to a document that is read by Apache then that directive might not be observed in time to prevent the document being served.
Another example, the directives that gzip output are best placed at the top of .htaccess so they take effect immediately and not after the files have already been served.
Placement does matter.
Maybe prepend the directives to htaccess and include DirectoryIndex at the top?
from wp-h5bp-htaccess.
Related Issues (10)
- By plugin do you mean edit functions.php and include the file? HOT 8
- Is this working? HOT 6
- .htaccess file is corrupted after WordPress update HOT 5
- Release New Version with Bugfixes HOT 3
- htaccess in subfolders being blocked
- License.txt? HOT 4
- Conflict Plugin Name with other WP H5BP .htaccess Plugins HOT 3
- Add rules to secure wp-includes? HOT 1
- Vary Accept Encoding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-h5bp-htaccess.