View a site without a domain WITHOUT updating hosts file? - wordpress

I have a few sites I developed that I need to show my client for review. These are all redesigns of live sites, so they've had me upload them to their new hosting server, which is currently accessible via IP address because the domains are currently in use by the live sites.
I've set each site up as add-on domains in cpanel, and they all live in directories off the root, like 192.0.2.3/site1.example (for example).
However, these are Wordpress sites, and the database references the actual domain name (site1.example), so that it will be all set for launch when we update the DNS to point to this server. That means you can't actually see the site at that domain unless you update your hosts file. But there are lots of non-technical people that need to review the site, and updating their hosts file just isn't an option.
I'd rather not have to do a search and replace on the database to change the domain to 192.0.2.3/site1.example temporarily, just so they can view it. Because when we're ready for launch, I'll just have to do another search and replace to switch it back to the real URL. But it seems like that's my only option.
Is that correct, or is there another way they can view the site without me having to update all the URLs in the database?

The best solution here is to search and replace the URL just as you said

Related

Moving a wordpress site without passwords or access

I am looking after a site where I have no access from the previous web designer. I have gained access to the domain name, and now want to move the site to my server.
So far I have been able to copy the site using some software I found, and I have the files locally on my computer.
How do I keep the existing site but gain access so that I can update the site?
Will all the links and SEO be disturbed, if I just transfer all files to my server?
there is no way to directly copy the site if you don't have access to the server. What you can do is replicate the site. In other words, copy paste all text and images down from the old site. It sounds like you have already done that. Then you set up a fresh WordPress installation on a new server, install the same theme and plugins as you had on the old server and then copy paste in all text and images that you saved previously. Then you can register your site with for example Google Search Console and via that keep track of which URLs that are now returning 404 and set up redirects or new pages for those URLs.

Installing multiple different instances of wordpress on the same website

I currently have a website up and running that is my freelancing website. What I wanted to do was create a testing subdirectory on the website.
So for example my site would be:
website.com
I want the testing site to be: website.com/test
I need this test to be private and require a password to view, as well as be a different installation of wordpress so I can manipulate it without editing my main website. Is this possible? Currently I have created a test directory from the cPanel that requires a password but it just brings me to a 404 not found page.
I would also like to create more, public, instances that I can use as a portfolio until I get more real clients. So for example I would like to have my site be: website.com/themeOne
Is any of this possible, or am I out of luck? Please let me know I would greatly appreciate any help. Anything I found found online thus far has either not been relevant or has not worked.
You can achieve this by setting up a wordpress multisite installation. I currently use this to host all my clients.
Will work like this.. Main site is website.com
Depending on how long you have had that site set up will determine whether your multisite install will be a subdirectory or a subdomain. If you have had your main site for a while it will be subdomains. ie. xyz.website.com
You will have to set up a wild card subdomain on your server though...so keep that in mind.
Here is the documentation on setting up a wordpress multisite
https://premium.wpmudev.org/blog/ultimate-guide-multisite/
You can install as many WordPress instances as you like in subfolders example.com/test/ or subdomains test.example.com in one hosting account; see http://codex.wordpress.org/Installing_Multiple_Blogs. (You are, of course, limited if your host does not support subdomains. And you may find lots of sites with lots of traffic will slow your whole hosting account.)
For these separate WordPress installs, you can use the same database; simply give each WordPress install a different database table prefix in wp-config.php. https://codex.wordpress.org/Editing_wp-config.php Or, give them all the installs a totally different databases, only limited by your hosting account.
To control access to a WordPress site, there is no need for access control in .htaccess or via Cpanel; use any one of a number of plugins that allow you to restrict access to anyone not logged into WordPress. See https://wordpress.org/plugins/search.php?type=term&q=password
And you can still control the user's role when they are logged into the site with one of those plugins, i.e. editor, administrator, etc., from within WordPress. That's because you want to give a client a Subscriber user level so they can simply login and view the site, rather than Administrator, who can see posts, plugins, etc. See https://codex.wordpress.org/Roles_and_Capabilities
There is no need for WordPress Multisite, unless you want to go that way: see https://codex.wordpress.org/Create_A_Network But be aware that MS requires more server and DNS configurations if you want to use Domain Mapping: https://wordpress.org/plugins/wordpress-mu-domain-mapping/

How to change the domain only without migrating the files

I have two business domains, for example, domain.com and dev.domain.com.
Since I had to keep the old website for running the business while developing website, I keep the old website to domain.com and bought the new theme, installed, and developed in dev.domain.com.
After finished the development, I wanted to use the domain.com instead of dev.domain.com, but when I migrate all the file, all the plug-ins were not working because of license reason.
Since I don't want to develop entire website again, I just made domain.com to forwarding to dev.domain.com.
Is there way I can change domain to domain.com?
Thanks,
Not entirely sure but you're probably getting errors because WordPress saves the site URL in the database so after you move the files to domain.com, the database is still requesting stuff from dev.domain.com. Changing the one table in the database (site_url under wp_options) is sometimes enough but if you've been developing a site I'm guessing you've got a bunch of links and images set up with the dev.domain.com URL. What I usually do when migrating a dev site to live is...
Set up a new Database and User/Pass for the new live site.
Export the database from the dev site.
Open the database in Notepad++
Use Find and Replace (ctr+h) to find dev.domain.com and replace with
domain.com, choosing Replace All.
Now import this database to the new database you set up earlier, and
change the wp-config.php database settings to the new database.
Be sure to keep copies of the backup before you edit the database in case anything goes wrong, but you should be good. This is how I do it all the time.
https://codex.wordpress.org/Moving_WordPress#If_You_Have_Accidentally_Changed_your_WordPress_Site_URL.
This https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ is probably a better method than trying to load your entire db into a single text file is not the most viable option.

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!

how to switch domain of two wordpress site with each other

I have two wordpress site on same server with different domain name.
here is first one
here is the second one
My client is saying that he want to switch the domain name for both site with each other that is first domain will work on second one and second on the first one.
how to do this any idea or help will be appreciated.
Thanks
The free way:
Download each site to separate folders on your hard drive.
Make a database backup of each site with phpmyadmin
Delete both websites via ftp
Clear out both databases
Upload site 1 to site 2's former location and vice versa.
Load up phpmyadmin and restore database 1 to database 2 and vice versa.
In each database, open up the wp_options table and change siteurl and home to reflect the new domain name
Using phpmyadmin's search function, search for the old url in all tables, and manually update them if necessary.
The paid way:
Use ManageWP or BackupBuddy to assist in automating the above. With either tool you can make a full backup and then restore to a different server, and they automate the domain name change.

Resources