An expected error has occurred. Please reload the page and try again (OJS 3.4.0.7)

Hello team,
Kindly assist me with this.
I have upgraded to the latest OJS 3.4.0.7 from OJS 3.4.0.4.
The system worked fine before, but now it can not save submissions or changes that require saving.
I believe I messed up somewhere when I wanted to secure it with the Apache2 mod_security2 module after the upgrade.
I inspected the browser traffic and found permission issues with API.
I tried some codes in the .htaccess I found from the community but could not make it work.

This is the code I use in the htaccess file

# Enable the rewrite engine
RewriteEngine On
# Handle the OJS URL structure
RewriteBase /
# Redirect requests to the index.php file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.)$ index.php/$1 [L]
# Allow API access
RewriteRule ^api/(.
)$ index.php/api/$1 [L]
# Custom error handling
ErrorDocument 404 /index.php?op=404
# Disable directory browsing
Options -Indexes
# Set default charset
AddDefaultCharset UTF-8
# Other optional settings

Header set Access-Control-Allow-Origin “*”

The screenshot from Google Chrome is attached below;

I kindly ask for your assistance. Thanks in advance.

I found out the error was caused by Apache mod_security rules blocking the saving process.
I have disabled the particular section of the rule that was blocking the saving process, and now it works fine.
I have to work on the best practice of the mod_security application. If you have, please share.

This topic was automatically closed after 8 days. New replies are no longer allowed.