ERR_SSL_PROTOCOL_ERROR after migrating WordPress site to another site - attempting to create staging environment - wordpress

I have a site hosted on 1&1 Ionos hosting. Purchased an SSL for the site from 1&1 Ionos as well. So let's say https://www.business.com/ is what I have. Then I have another another site say http://www.mycompany.com/ hosted at the same place - still waiting for my business SSL to be approved hence the http.
So I exported the database from business.com using plugin WP Migrated DB - setting the new URL and actual filepath.
Then I imported the database into a new database for my staging environment to be hosted at http://www.mycompany.com/clients/business.
I copied ALL the wordpress files for the site http://www.business.com/ into http://www.mycompany.com/clients/business exactly except I changed wp_config.php file to reflect the new database details. i.e username, database, location and password.
So I expected http://www.mycompany.com/clients/business to be a complete replica of the original https://www.business.com/. But when I browse to http://www.mycompany.com/clients/business I get the following error:
This site can’t provide a secure connection mycompany.com sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR
I can't even login to the admin panel of http://www.mycompany.com/clients/business/wp-admin
Is what I tried even possible and if it is please tell me what I did wrong and how to fix it. I'd like to create a staging environment to test new themes and plugins before implementing on live environment. Critical to my original site is the aMember plugin which manages all the membership registration info. I've deleted the Really Simple SSL plugin folder from WP-Content/Plugins folder but the error remains.
Thanks in advance for any and all help and advice!

Step 1:
Check your .htaccess for rules enforcing https
Step 2:
Did you replace all links in the database? If not, you must search and replace all links from https://www.business.com/ to http://www.mycompany.com/
You can use a tool from: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/comment-page-4/
Or just use command line wpcli (wp search-replace https://www.business.com http://www.mycompany.com
Step 3:
Open the new 'http://www.mycompany.com/' in a incognito tab. Browser caching might still redirect you to https.

Related

Migrating Site To Digital Ocean and having trouble with redirecting to HTTPS

I am migrating my site to digital ocean and I am having an issue with Https. I have moved the directory and the apache2 config file and mysql database. I believe I set everything up correctly but now I want to test it. I have edited my /etc/hosts file with my new ip and sitename.com. However when I try to go to my browser and look to see if the site works it keeps trying to redirect me to the https version of my site.
I have tried going to chrome://net-internals/#hsts and deleting the site but it still redirects to https. How can I test my site without being redirected to the still hosted version of my site?
Thanks!
Aside of the wp_options field, WordPress stores lot's of links 'hard-coded' which all will contain the https. You would need to do a full search and replace on the database, but be aware of serialized stuff. To to safely perform a search and replace you could use a program found on: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Works like a charm.
Another way is by using wpcli if you have commandline access and wpcli is available. From the command line go to your root directory (containing the index.php) and type:
wp search-replace https://www.your-domain.example http://www.your-domain.example
Or type:
wp search-replace https://your-domain.example http://your-domain.example
Based on your setup up course.
Always make a full backup of your database before performing these actions, so you can restore if any problems occur.

Changing URL Wordpress- still not working despite checking/editing database

As much as may sound like a broken record - I changed the URLs on my WP site, and now I get a 404.
What I wanted to do:
Change site URL from www.SiteA.com to www.SiteB.com
All WP files were at the time in another directory in the same hosting account. I needed them in the root directory, accessible by www.SiteB.com
What I did:
Backed up locally and remotely - Database and files.
Edited URL's through dashboard on WP - got a login error afterward, but seemed to do it anyway.
Moed ALL old site files from root to backup folder.
Moed ALL wordpress files from original directory to root directory.
Then I got a 404 error and was unable to access WP-admin or login through the new or old URL.
What I tried to fix the issue:
Noticed http should be https - changed this in 'options' within phpmyadmin, both at 'siteurl' and in 'home'.
Still 404
Then I tried defining the db_name in the wp-config file.
Still 404
Then I gae up, changed the URL's back using myphpadmin, and moed the filed back to their original directory. Now I can login to WP as usual and eerything is fine.
Why can't I access the site when I moe it into the root directory - I thought I had all the steps right!
Thanks in adance for any help
oh..and apologies, my keyboard is missing a few keys :(
Wordpress stores url/permalinks on database field values as well, changing only the configuration files will not be enough.
I am pretty sure there are other options, on my case i use often perform Wordpress website migrations, and the following tool becomes really handy when search and replacing domains on the database records.
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Hope it helps.
Jose
This happened to be an SSL issue where the host for our SSL certificate was conflicting with the stylesheet somehow. 0_o

Website preview for a wordPress based site on a development server

I have created a demo website for a client. I installed the site on the client's live domain name and I used the etc/host DNS trick to point the domain to my development sever. Now I want to send a live preview to client for validation but I don't want to bother her with technical details such as modifying local computer host file. The client doesn’t want to switch the domain to the new site either, until everything is ready as the site is highly active. I have tried the cpanel temporary link (mod_userdir is enabled) but it breaks everything including styles and scripts. Do you have any solution. Thanks.
Update: I have found this site if it can help nodns.io, they only need the emulated domain name and the development server IP.
You can still use the temporary URL and that is the easiest way. You just need to make a change in the WordPress database. You can go to cPanel -> phpMyAdmin, open the database and look for the _options table.
Once you find it, you need to change the home and siteurl options to the temporary URL:
https://codex.wordpress.org/Changing_The_Site_URL
You can follow the "Changing the URL directly in the database" directions.
Goodluck!

Wordpress clone on Dreamhost

So I created a new subdomain on Dreamhost. One-click installed Wordpress. Fresh Copied the olddomain.com to newdomain.com exported all the tables with the drop attribute to the new wordpress database via phpmyadmin. Then followed this post to update the urls.
The site doesn't load, giving me this error message:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
I would make sure to check the 'www' rules in Fully Hosted (from the web panel: Manage Domains > Web Hosting > Edit), compared with your site URL settings in the WordPress dashboard. Make sure those aren't conflicting first.
If you need further assistance, just let me know the domain name and I can take a look. Please also feel free to start a LiveChat from the panel or submit a ticket; our support team is here to help 24/7!
Thanks!
Ellice S
DreamHost Staff
I finally ended up creating an empty site and then using the WP Duplicator plugin. Worked like a charm!

Problems in migration from localhost to my online webserver of a WordPress website

I am finding some problems uploading a WP site from my local web server to the official online web server.
The situation is the following , on my local web server:
I have installed WP website on my computer
I have configured it
I have installed custom a template
After, I have uploaded this site in a folder on my official online web server. I have took the local database export and imported in the online database using PhpMyAdmin (to export the local database on a file and then to import it on the online database)
Finally I have changed the file wp-config.php changing the MySql connection settings and putting here the settings related to the official online database.
When I try to open the website it appears to me, here you can say how: http://www.scorejava.com/wordpress/
Ok...seems good but there are two problems:
If you try to open an article it is not open the article on the online server but in the localhost server, infact open this URL: [code]http://localhost/wordpress/?p=81[/code]
If I try to open the administration panel opening this URL: [code]http://www.scorejava.com/wordpress/wp-admin/[/code] I obtain a white page
I don't know if these two problems are related together but I think that all may depend due to a problem of location path...
I think that somewhere there is some settings that specify the URL (that can't be localhost...), but (if it is so...) where is this setting? in some file or in the database?
Some one have an idea? Can you help me?
Look into this: http://codex.wordpress.org/Moving_WordPress
There's a link on there for a "Search and Replace for WordPress Databases Script" tool that's very handy (make sure to read the instructions and have a backup of the db before using it). The problem is that image URL's and other things are stored in the database and will reflect the URL of the dev location. That tool will go through and properly update all instances from the dev URL to the final location.
Normally before you move a WP site you also want to update the site URL in the General settings as well, which may be contributing to your second problem.

Resources