Repository navigation
Openlitespeed Server Downloads Pages as Files #2409
Description
Activity
Hi @thekendog 🤚
We weren't able to reproduce the issue. May I kindly ask you a screencast (video) of the problem?
Or if you still have the issue, could you please open a ticket support (https://wp-rocket.me/support/) and provide your WordPress and FTP access.Thanks
So I figured out the issue and it's some kind of error in my WP Rocket import file I believe. I have two sites both on OLS. One is working fine and the other isn't. Both are running 3.5.1. I looked in .htaccess. The one that wasn't working and was downloading had this in it.
<IfModule mod_mime.c> AddType text/html .html_gzip AddEncoding gzip .html_gzip </IfModule> <IfModule mod_setenvif.c> SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} on [OR] RewriteCond %{SERVER_PORT} ^443$ [OR] RewriteCond %{HTTP:X-Forwarded-Proto} https RewriteRule .* - [E=WPR_SSL:-https] RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* - [E=WPR_ENC:_gzip] RewriteCond %{REQUEST_METHOD} GET RewriteCond %{QUERY_STRING} ="" RewriteCond %{HTTP:Cookie} !(wordpress_logged_in_.+|wp-postpass_|wptouch_switch_toggle|comment_author_|comment_author_email_) [NC] RewriteCond %{REQUEST_URI} !^(/(.+/)?feed/?|/(?:.+/)?embed/|/(index\.php/)?wp\-json(/.*|$))$ [NC] RewriteCond %{HTTP_USER_AGENT} !^(facebookexternalhit).* [NC] RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" -f RewriteRule .* "/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" [L] </IfModule>I removed those lines.
EDIT: No clue why those rewrites were being added. Removing them works though.
Reacted by Rahat Mahmud- addedcan't reproduceIssues that can't be reproducedIssues that can't be reproducedcommunityIssues created by someone outside of our teamIssues created by someone outside of our teamand removed
on May 15, 2020 @thekendog Sorry for the delay.
These rewrite rules are added to speed up the process to deliver a caching page.
May I kindly ask you to open a ticket support? Then one of our support engineer will be able to investigate directly on your website the problem.
Thanks
@GeekPress please can you re-open this - we continue to have tickets about it
Related ticket - https://secure.helpscout.net/conversation/1386879528/228665/
OLS sending application/octet-stream header for HTML pages when WP Rocket is activated.
The htaccess file wasn't corrupt after enabling WP Rocket.
Disabling our htaccess rules didn't fix the issue.
Updating from 3.8.0.1 to 3.8.2 fixed the issue.
Issue still there.Reacted by Nader AbdiRelated (note that it's been reported on both LiteSpeed and OpenLiteSpeed)
- https://secure.helpscout.net/conversation/1388210056/229079/
- https://secure.helpscout.net/conversation/1174899370/167774/
- https://secure.helpscout.net/conversation/1147299432/160808/
- https://secure.helpscout.net/conversation/1132305409/156800/
- https://secure.helpscout.net/conversation/1166151295/165569/
Related ticket - https://secure.helpscout.net/conversation/1399061409/232220/
Related ticket: https://secure.helpscout.net/conversation/1398448947/232009
27 remaining items
Facing same problem, using OpenLiteSpeed on AAPanel with WP Rocket.
Removing below line added by WP Rocket in .htaccess fixed the problem but probably disabled serving gzip - RewriteRule .* - [E=WPR_ENC:_gzip]
Any fix for this ?
UPDATE FOUND SOLUTION: Seems to have found the issue & its solution (although don't know the logic but applied some common sense). Solution - In .htaccess file of your website in rules added by WP Rocket change
"RewriteRule .* - [E=WPR_ENC:_gzip]"to"RewriteRule .* - [E=WPR_ENC:-gzip]"Solution was inspired by another similar line which was 2 lines before above line which was using "-" instead of "_" (line was"RewriteRule .* - [E=WPR_SSL:-https]") so tried it and it worked, cache & gzip both working now without DOWNLOAD problem.Would like some comment/feedback from WP Rocket about this change/solution.
I removed the gzip line and the website is working again.
Same environment as described before: LiteSpeed and CyperPanel.
To prevent the htaccess from happening again I used the nogzip sent by @webtrainingwheels.Just a suggestion for the developers here:
If a lot of users keep having problems and need to rely on helpers written as plugins, why not implement a new tab on the wp-rocket plugin named 'Helpers' with checkboxes for each problem, for example:- - remove all wp rocket rules htaccess
- - remove gzip
- - remove trailing-slash
- - etc etc
This way, it would be easier for nontechnical users to troubleshoot the problems and fix the problems.
Reacted by Nader Abdi, twest, Fadhlillah Ariefianto, Boris and Gui Domingues"RewriteRule .* - [E=WPR_ENC:_gzip]” to “RewriteRule .* - [E=WPR_ENC:-gzip]" in my .htaccsess fixed this
Reacted by Nader Abdi and Praveen NelsonWP Rocket Version 3.15.9 on OpenLiteSpeed server. Same error - downloading site.
"RewriteRule .* - [E=WPR_ENC:_gzip]”
to
“RewriteRule .* - [E=WPR_ENC:-gzip]"Do not fixed error.
me neither, this does not work. I tried to disable cache module on litespeed but no luck. issue is coming back after a while
- addedseverity: moderateFeature isn't working as expected but has work around to get same valueFeature isn't working as expected but has work around to get same value3rd party compatibilityIssues related to 3rd party compatibility like theme, plugin or hostingIssues related to 3rd party compatibility like theme, plugin or hostingand removedseverity: moderateFeature isn't working as expected but has work around to get same valueFeature isn't working as expected but has work around to get same value3rd party compatibilityIssues related to 3rd party compatibility like theme, plugin or hostingIssues related to 3rd party compatibility like theme, plugin or hosting
on Nov 27, 2024 - addedpriority: mediumIssues which are important, but no one will go out of business.Issues which are important, but no one will go out of business.and removedpriority: highIssues which should be resolved as quickly as possibleIssues which should be resolved as quickly as possible
on Feb 24, 2025
Describe the bug
I'm using the plugin on an Openlitespeed server. When enabled, at random times when I go to a page as an anonymous user the browser downloads it as a file (called download). It is not consistent and I can't intentionally replicate it. When I see the issue and then deactivate the plugin I do not get this issue. This is not the first site, nor the first OLS server I've seen this behavior on.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Page loads as normal