0

I migrated my site to a new server. Everything seems to be fine, but the browser is redirected to the frontpage when I save configurations in either the "W3 Total Cache" plugin or in "Duplicate post" plugin. It does save the edits, but it´s annoing with the redirect.

For example when I press purge all caches from W3 Cache, it is redirected to

www.mysite.com/?w3tc_note=flush_all

I can´t find a solution that solves it. I tried with:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

In my wp-config.php

And with these google results: Redirecting to home-page when saving any edited code https://wordpress.org/support/topic/wordpress-5-0-beta3-redirects-to-wp-admin-edit-php-after-hitting-enter-key/

I also looked at the wp_options in the DB. But seems allright.

I tried to change the wp permanent link options in the admin settings too.

The "Duplicate post" plugin was installed after the site migration.

3 Answers 3

2

It's because you have set the Referrer Policy header incorrectly set in the W3TC page cache.

Referrer Policy
This header restricts the values of the referer header in outbound links.
**Directive: same-origin**

...will fix it. If your overall Directive is "same-origin" and you set the Referrer header to something different (such as "origin"), this error will occur. I changed mine to same-origin and the problem was immediately fixed.

1
0

It is a bit hard to really know what is going on. But a best "guess" is that you have a plugin that is redirecting and/or conflicting with the theme. By process of elimination, I would deactivate all the plugins and see if the problem still exists. If it disappears, reactivate, one by one. Somewhere there is a conflict and doing a redirect.

A secondary effort would be, after all the plugins have been disabled and assuming it still exists, then change themes.

You have to narrow this down to the most basic element.

3
  • Thanks! But after deactivating all plugins and switching to one of the twenty theme + deleting cookies, it still does the redirecting error :( Mar 8, 2019 at 11:32
  • then I would be looking at some malware or changes to functions.php. Something is causes the redirect. Mar 8, 2019 at 17:31
  • Thanks! I can´t see anything in the functions should be wrong though. And nothing else seems to be wrong. I also tried to look through the DB for any hardcoded URLs Mar 12, 2019 at 10:23
0

Okay, I found a solution. To anyone in the future having this problem here's what i did:

  • I used the plugin "Duplicator" and made a package of the site.
  • Then i downloaded the installer and the archive.
  • I then deleted everything in the database and on the ftp.
  • Then I transfered the archive and installer file to the FTP and run the installer.php

Now everything works again :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.