Plugin Contributor
iSaumya
(@isaumya)
Hi @pklinaf,
Honestly, the chances of this plugin creating 500 error are very thin as we test the plugin across multiple different servers before releasing it. But the good news is that it is a 500 error which means there should be server error log showing exactly which file from what line of code is throwing the 500 error to easily track it. Talk to your host to check the error log file.
I personally think some other plugin might be creating a conflict and is the reason behind the error 500. But the server error log only has the answer of what’s causing it.
Hi Saumya thank you for your response. Ok I looked at the log and here’s what I found relating to the plugin:
Invalid command ‘<If’, perhaps misspelled or defined by a module not included in the server configuration, referer: https://[mydomain]/wp-admin/options-general.php?page=wp-cloudflare-super-page-cache-index
I replaced the referer domain in the above message with [mydomain]
Noting I am using an old php v7.0.33 do you think it’s because of this ?
Plugin Contributor
iSaumya
(@isaumya)
Hi @pklinaf,
Is that the error log or access log? Cause as t is error 500 it should give a fatal error to generate that. Also there generally is a line number and file name showing where it is coming from in the log.
Hi @pklinaf ,
are you using an Apache version older then 2.3?
@salvatorefresta probably yes, I just found out that if expressions are supported since apache 2.4 so we may have found the cause of the error.
Is there a way around this for older apache servers? Meaning, do you have a fallback solution?
Plugin Contributor
iSaumya
(@isaumya)
Hi @pklinaf,
You can try changing the following code in .htaccess
file:
Change:
<IfModule mod_headers.c>
<If "%{THE_REQUEST} =~ m#\s/+wp-json/?[?\s]#">
Header set Cache-Control "max-age=0, public"
</If>
</IfModule>
To:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType application/json "access plus 0 seconds"
</IfModule>
And see if it works. Let me know.
Hi @isaumya, that actually worked. However that if stmt gets rewritten to .htaccess everytime settings are changed.
Any plans to support apache < v.2.4 ?
Plugin Contributor
iSaumya
(@isaumya)
Hi @pklinaf,
You can just edit the .htaccess and comment out that line. Apache 2.4 was released in 2012. We are now standing in 2021, 9 years from the release. I think it is high time that the users should force their hosts to upgrade to Apache 2.4.
What you are asking for we will check internally if something like that will be possible.
Thank you @isaumya. You’re absolutely right about this. Again, thank you for your time.