Page editing in backend redirecting to 404 page not found with url /post.php

Today I migrated a WordPress site from another server to a new server, there is a new domain and new host, so I follow the manual way to upload my site. That was, I downloaded files and upload it on to new fresh host and, database export and import to the new host. After that, I have changed site URL, home page URL in the database, so site looked fine.

But when I try to edit a page, that my back end editing redirects me to 404 page not found. But this issue is only for some old pages while making new page has no issues whatsoever.

After that, I changed all the past domain record matching database records and replace them with the new domain name. Still, I cannot edit my pages.

I tried all the listed ways like .htaccess, permalinks reset, deleting the .htacess and resetting permalinks, but none of that has worked.

Please help me out is very frustrating

Topic redirect 404-error Wordpress

Category Web


This problem is because of your old database file still having traces of your old domain. Before uploading your database file to your new domain/website, you should manually replace every occurrence of your old domain with the new domain.

You should also edit your wp-config.php file, and add these lines.

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

You should also read the official documentation for changing the site URL.


WordPress stores the domain in a lot of places - not just the options table - and in many places it's serialized, so if the new domain does not have the same number of characters as the old domain, a lot of things can break if you try to manually search and replace.

You can either use a tool like WP-CLI, or look for a database migration plugin. The plugins tend to be the quickest, easiest way unless you're already familiar with WP-CLI. Some hosts also provide migration services, so you might want to leave it to them if they provide the service for free.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.