Title: Error Page when saving
Last modified: January 29, 2021

---

# Error Page when saving

 *  [woodybfc](https://wordpress.org/support/users/woodybfc/)
 * (@woodybfc)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/error-page-when-saving/)
 * I ran across a problem migrating a site from one host to another. I developed
   a script that would detect the current user and role and then redirect based 
   on the current page and user. It invoked the wp_get_current_user() function. 
   On the first host it worked flawlessly, but when I moved to the second host, 
   it would fail when trying to save the script. When I hit the Save Changes button
   the page would either return a 403 Forbidden error or it would load the main 
   page of the front end and return a page not found error. After doing some research,
   I found a related issue and reached out to my host to see if it applied to my
   situation and sure enough that was the issue. The issue ended up being a mod_sec
   setting on the second host. When I explained the problem, my host tweaked the
   mod_sec rules for my account and the plugin is working as expected once again.
   I am sharing this because I looked for almost a week trying to resolve the problem
   and could not find a direct solution anywhere. If you are seeing strange behavior
   with this plugin (or similar plugins that inject code) reach out to your hosting
   provider and see if they can adjust their mod_sec rules on Apache servers.

The topic ‘Error Page when saving’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/my-custom-functions_0e1030.svg)
 * [My Custom Functions](https://wordpress.org/plugins/my-custom-functions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/my-custom-functions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/my-custom-functions/)
 * [Active Topics](https://wordpress.org/support/plugin/my-custom-functions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-custom-functions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-custom-functions/reviews/)

## Tags

 * [403 error](https://wordpress.org/support/topic-tag/403-error/)
 * [404-error](https://wordpress.org/support/topic-tag/404-error/)
 * [mod_sec](https://wordpress.org/support/topic-tag/mod_sec/)

 * 0 replies
 * 1 participant
 * Last reply from: [woodybfc](https://wordpress.org/support/users/woodybfc/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/error-page-when-saving/)
 * Status: not resolved