WordPress managed hosting provider WP Engine announced that it is ending support for .htaccess directives. WP Engine has started End-of-Life (EOL) processes for winding down the use of .htaccess on their servers and have set a date of October 2022 for full removal of support.
The use of .htaccess as a tool for managing websites is so deeply ingrained that the idea of no longer supporting .htaccess may sound like a deal breaker. Some may rightly think that if customers can’t have a custom .htaccess then the web hosting service might not be suitable for how modern sites are created.
But a closer look at what WP Engine is doing shows that the decision makes sense and more surprisingly, this may in the future be a common feature of high performance web hosting.
Why WP Engine Deprecating .htaccess Support
The reasons WP Engine gave for leaving .htaccess behind were about achieving performance gains from removing .htaccess from the site-level and also being able to take advantage of performance gains from newer technologies.
The announcement stated:
“WP Engine will be deprecating the .htaccess file in order to increase website performance and match industry trends.
If your site is using custom .htaccess directives outside of the default WordPress rules, we have put together a list of recommended alternatives.”
WP Engine estimates that this change will not affect most websites that it currently hosts because most sites are only using the default version of .htaccess that WordPress generates.
“By our analysis, most WP Engine websites will not require any extra changes to the .htaccess as they are using a default WordPress version of this file.
Default WordPress rewrites will be handled by WP Engine automatically at the server level.”
.htaccess and Site Performance
.htaccess is a way to control certain aspects of a website, like redirecting a request for one URL to another URL, redirecting requests for insecure HTTP URLs to secure HTTPs and for blocking the IP addresses of malicious hackers and scrapers, among many other uses.
.htaccess is a file that is used on servers that run the Apache open source server software (as well as, for example, Nginx servers that run as a reverse proxy for Apache).
The use of .htaccess files is a longstanding and established practice for managing websites.
However, something that may not be commonly considered or discussed is that the use of .htaccess files is not an efficient way of managing activities like blocking IP addresses or redirecting URLs.
When .htaccess files become very large they can have a negative impact on SEO and conversion-related metrics such as the Time to First Byte (TTFB), a metric that measures how long it takes for a server to begin downloading web page resources.
According to a test by StrategiQ that quantified the impact of .htaccess on performance, they discovered that .htaccess files can have an impact on both server performance and scalability.
What they discovered was that a large .htaccess file had a measurable and significant impact on CPU usage. Testing also revealed that an .htaccess file with as little as 1,000 lines could have a “significant” impact on server memory usage.
They noted that the extra strain was not enough to bring down the website because the server still had enough resources to handle the strain.
“It’s worth noting though that during our tests, we didn’t see any huge impact on overall page load time on anything but the 50,000 line file. This is probably because, even though significant resource was being used in handling the requests, we still weren’t hitting peak capacity.”
Yet one can imagine that a server with multiple websites with large .htaccess files could cause an impact on the server.
Secondly, what may come as a surprise to many, is that according to the official Apache Software Foundation (the developers of the Apache server software that runs .htaccess), the only time .htaccess files should ever be used is when access to the server configuration file is restricted, such as one might find on budget shared servers.
The Apache Software Foundation documentation advises:
“There is, for example, a common misconception that user authentication should always be done in .htaccess files, and, in more recent years, another misconception that mod_rewrite directives must go in .htaccess files.
This is simply not the case.
You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things. Likewise, mod_rewrite directives work better, in many respects, in the main server configuration.”
What WP Engine is proposing is actually a best-practice according to the Apache documentation and in the short and long run it will benefit their user base by creating an environment that may make their websites perform faster, which helps sales, advertising clicks and has a small SEO benefit.
Will WP Engine Users Be Inconvenienced?
WP Engine offers ways to get around using .htaccess files by the use of what they call Web Rules. Web Rules allows users to manage IP-based allow/deny rules and for setting header responses.
Redirects can be applied three ways within the WP Engine managed hosting platform:
- Bulk imported into WP Engine’s Nginx configuration
- Bulk imported into a WordPress plugin called Redirection
- Bulk imported into the Yoast SEO Plugin redirect manager
I use the Redirection WordPress plugin on some of my websites and have found it to be an easy way to manage redirects and headers.
The plugin also has a convenient log file that shows you visits that result in 404 responses which can alert you to inbound links that are misspelled (which can be fixed by creating a redirect for the misspelled URL to the correct URL).
WP Engine End-of-Life (EOL) Process For .htaccess
While at first it may seem like a radical idea to end support for .htaccess, considering how the Apache Software Foundation itself recommends not using .htaccess at the website level, the approach that WP Engine is taking makes a lot of sense.
There are clear benefits for their users and for website visitors as well.
Will other web hosts follow their lead?
Read the WP Engine Announcement
Read The Apache Software Foundation’s Advice on .htaccess
!function(f,b,e,v,n,t,s) if(f.fbq)return;n=f.fbq=function()n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments); if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=;t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e); s.parentNode.insertBefore(t,s)(window,document,'script', 'https://connect.facebook.net/en_US/fbevents.js');
if( typeof sopp !== "undefined" && sopp === 'yes' ) fbq('dataProcessingOptions', ['LDU'], 1, 1000); else fbq('dataProcessingOptions', );
fbq('trackSingle', '1321385257908563', 'ViewContent', content_name: 'wp-engine-ending-htaccess-support', content_category: 'news wp ' );