Question: #migration#wordpress from #Production to the #localhost, issues, the best and easiest solution.
Note for #hackers: Here I am writing my folder name and other #sensitivedata information about my website. It’s an open invitation for the #hackers you can’t able to hack my website, an open challenge (because I am the father and dad of the hackers)
What I did: I have a website live, i.e., http://aradhyaarya.com, and I copy the same project folder and the same database to the localhost.
Tell me the #problemsolving in a little detail:
Migrated WP from
aradhyaarya.com/
to
localhost
and
Converting URL
from
http://aradhyaarya.com/interview/csharp/
to
http://127.0.0.1/aradhyaarya.com/interview/csharp/
It’s giving an error #404, but the below URL is working fine.
http://127.0.0.1/aradhyaarya.com/
Tell me the #solutions, please.
Solution step :
Close your eyes. Take a long breath for a minute.
Step 1: Change database:
siteurl=http://127.0.0.1/aradhyaarya.com/
and
home = http://127.0.0.1/aradhyaarya.com/
in the database, Table: wp_options
Step 2: (Not required until you have
WPS-hide-login plugin, if you have one, then
in my case, I renamed (_wps-hide-login) the plugin from the Plugin folder and did change as below in the database same table wp_options column name= active_plugins
Before
a:2:{i:0;s:17:”hd-quiz/index.php”;i:1;s:33:”wps-hide-login/wps-hide-login.php”;}
After
a:1:{i:0;s:17:”hd-quiz/index.php”;}
Step 3: Login to wp-admin->Setting-> Permalinks
Copy the .htaccess #htaccess and write below ( i:e: RewriteBase)
So new code is as follows:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /aradhyaarya.com/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /aradhyaarya.com/index.php [L]
</IfModule>
Earlier it was:
# BEGIN WordPress
# The directives (lines) between “BEGIN WordPress” and “END WordPress” are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Step 4: Nothing, just enjoy the solution, work done.