Wordpress website not opening after duplicating on local server - wordpress

I deployed my website from server to my local machine using duplicator plugin. The deployment was successful (no errors). However when I am trying to open the website I get a blank page.
I am using latest version of MAMP server on windows machine. When I try to open http://localhost:8888, I automatically get redirected to http://localhost which is a blank page. Though I am able to access the dashboard through http://localhost:8888/wp-admin. How do I resolve this issue?

1- create index.html file with any text on your local server and try to access it via http://localhost to see if local server is working fine.
2- you need to export mySQL database from website & import to local mySQL server, because on server database urls and names are different.

Related

Why wordpress redirecting me to the old website, after I migrated it to my local machine?

I migrated my wordpress website into my local machine, but it's redirecting me to the original ,-server one-, website, immediately after I opennig the local one.
I try to describe what did I do as detailed as much I can:
First I got all wp files and copied-d it to my local XAMPP htdocs directory via SHH (FROM Linux Debian 10 - Apache 2 Webserver).
After that I exported the database (exported to sql file format).
I created the same database and user (with the same permissions as the server db user) in the local webserver
Everything went successfully, but after i want to open http://localhost/ I got redirected to my old site like https://originalsite.com
What did I tried to solve the problem:
I checked Apache, PHP and phpmyadmin version, but these are the same.
I reinstalled XAMPP but that also didn't solve the problem.
I checked wp-config.php but there aren't any options I've could been change, php.ini and my.ini both of them not gave me any alternative.
Thanks!
In the .sql file you imported, find "site_url" and change it to localhost URL. Or you can define it in wp-config.php file as "WP_SITEURL"
You will need to manually go in Database and Replace LIVE site URL with the Local URL.
Something like:
https://originalsite.com/
TO
http://localhost/originalsite

ERR_TOO_MANY_REDIRECTS while accessing Wordpress on linux site on HTTPS

Scenario/Background:
We have created Wordpress on linux Web App on azure.
Created My SQL server.
Uploaded all the contents of existing application to Azure using FTP.
Restored Database using My SQL workBench by Changing storage engine to InnoDB from MyISAM.
Configured Custom Domains to this Web App and also uploaded SSL certificate and Done SNI binding.
Updated the database connection detail and below site detail in wp-config.php.
define('WP_HOME','https://www.example.com');
define('WP_SITEURL','https://www.example.com');
We have not done any changes to .htaccess file.
Problem Statement:
While accessing https://www.example.com, we are getting below error :
www.example.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
Website is working fine on http... Problem is with just https... Is there any stuff we need to change from coding or anything else we should implement before directing to https.
Please add the following code to your wp-config.php :
if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"] ) && "https" == $_SERVER["HTTP_X_FORWARDED_PROTO"] ) {
$_SERVER["HTTPS"] = "on";
}
It works for me, hope works for you too.

Creating a localhost version of a secure / https / SSL website

I am trying to copy one of my websites to a localhost MAMP server for further development.
I bring you this as I am unable to access the site due to:
"This site can't provide a secure connection
localhost sent an invalid response.
ERR_SSL_PROTOCOL_ERROR"
I have:
Copied public_html folder to MAMP.
Copied Database Collation and Data.
Created a new user and applied this to the WP-config.
Removed the .htaccess instructions.
Adjusted the options DB to have http://localhost as 'siteurl' & 'home'.
Restarted my computer and local server.
When I go to localhost:8888 it reveals the folder I created. However, when I click it will add
https:// before the URL and give me the error.
Any help you can give would be appreciate, Jason.

Migrate SilverStripe website from one server to another

I migrated a SilverStripe website from one server to another. To do that I took the following steps:
Transferred a backup of the files from the old server and to the new server.
Dumped the old Database and imported it to the new server.
Updated _conn.php to connect to the new database.
Now when I hit the URL in a browser it is giving a 500 error. I didn't update the DNS for new server, instead I point to new server from my local system via hosts file. If I hit mywebsite.com/robots.txt, it is showing the robots.txt but not showing other pages.
500 error means server error which means something in apache(?), php or other logs. Ensure debug mode is on for SilverStripe to get the most information.
If all else fails start with checking your .htaccess is fine and redirecting and use with debug [die] statements progressively.
Ideally use the silverstripe-installer to debug any server issues and install a clean install, then you can copy the site over when you know it is working.

How to handle permalink of sites when migrating a wordpress website

What i want to do:
Develop a Wordpress-based website with a local Wordpress installation (and xampp).
Migrate this developed website on my webserver.
What's the problem:
After putting the website on the webserver each link in the navigation references to "127.0.0.1/wordpress/...".
I'm not even able to login to the Wordpress Backend on the webserver, because the "login.php" (or something) is also referenced on the localhost"
My Question:
Do any of you know how I can change this permalinks to the URL of the webserver the website is actually deployed on?
best regards
matt
edit:
Another thing that i noticed is, that although I changed the URL in the wp_posts table manually, this database entries are changed by wordpress, so next time, after opening the website, the URLs in the database contains the 127.0.0.1 part
When migrating the database from your local machine to a remote server, you should export your mysql database that is on your local machine to a file. Then perform a search and replace changing "127.0.0.1/wordpress/..." to "www.yourdomain.com/path/to/wordpress" and then import that file to your new mysql database.
Since you have already moved everything over, you can just export the database tables from your remote server to a file, do the search and replace on that, and reimport it. When exporting the database make sure to check "Add Drop Table / Drop View".
It's very simple, do everything you need in local, when you're ready to deploy, export your local database from phpMyAdmin, open the file and do "search and replace" your local path with your server path.
Chnage the connection string inside config.php and you're done.

Resources