A new client requested a new theme for his website (wordpress 4.4.3).
I copied the files and database so I can work on wamp so I won’t have to take the site down and I am now experiencing some problems: when I access the website I get “404 The requested page could not be found” and all other links go to the live site.
There are some redirecting plugins on the website but deactivating them hasn’t solved my problem, even deactivating all plugins doesn’t seem to work.
I also updated the permalinks by changing to default and then back to post name but no change.
Does anyone have a solution for me?
Add the following code to wp-config.php file. this will override site url and home url.
Now, You have add more 2 lines to your functions.php file of your active theme, so this will override your theme options.
But this the temporary solution , you need to find and replace url form database you can also use sql query to update. Following query will useful
You need to follow this guide to restore website
I think you should update the site URL.
there are two ways to do this
by Editing the wp-config.php file :
or go to Settings->General and change both of WordPress Address and Site Address then click update
In addition to MrRobot’s answer, you should edit your mysql dump file before importing inside. Replace all old URLs to your new URLs . You can use notepad or sublime text or whatever…