I am trying to make a clone of a Wordpress site into a subdirectory. So, I will have two installations, one in the root of the domain, and one in /test. My problem is that, even though I have changed the values for siteurl and home uri in database, my links will redirect to root. So, a page like domain.com/test/contact will redirect to domain.com/contact, which is not what I want.
You need to follow these steps to clone your WordPress website from production to staging server -
1. First export database of production server WordPress website and open SQL file in an text editor.
2. Then find your domain name(domain.com) and replace it at all places with your domain name/test like domain.com/test.
3. Import production SQL file to test database from phpmyadmin.
4. Open staging WordPress admin like domain.com/test/wp-admin and go to Settings > Permalink section. Just click on the Save button to update htaccess file.
5. Optionally you can go to setting at admin page and save all general settings, menus and check Widgets area too.
6. Now you can access your domain.com/test WordPress website.
Maybe is because your htaccess settings rewriterules.
Take a look to it or post it here.
Good answer, anil-meena
However these 5 steps can be done automatically with the wordpress plugin
WP Staging. I developed this plugin because the manual process of creating a clone site for testing takes too much time and is too complicated for the regular users.
So i hope it is useful for you.
Related
We have a dev site www.dev.site.co.za & a live site www.site.co.za.
I wanted the dev site updated to be a current replica of the live site, so our hosting provider copied it over.
But now when if you go to www.dev.site.co.za, you are "redirected" to www.site.co.za. I have tried changing the siteurl in phpmyadmin but that hasn't resolved the issue.
Is there somewhere else the url needs to corrected and is there anything else I need to do to make sure the dev site is a completely separate environment to the live site so I can safely fiddle without damaging the live site?
wordpress not only uses the database in PHPMyAdmin for the url.
As mentioned in the official documentation there are several files that can include the url:
the wp-config.php (wordpress file)
the functions.php (theme file)
Check these and have a look for the url address.
Have a look at the .htaccess file!
Also:
Helpful for that issue (e.g. restoring a wordpress page on another server) is the plugin BackupBuddy. It is one of the most well known plugins for wordpress. (Know right now that it is a paid version! But as always there are others with the functionality).
It allows you to backup and restore your page on a new system. You can initially set your new desired address for the system then.
Maybe it is worth a look!
For rectifying your dev site issue, you can try this.
Following is the URL to a simple utility via which you can replace some value in your database with some desired value.
https://github.com/interconnectit/Search-Replace-DB
Download the utility (zip file).
Upload it to your dev site root location and unzip it there. So that the the URL of the unzipped folder becomes: www.dev.site.co.za/Search-Replace-DB-master/.
Visiting that URL will show you the screen with options to replace some values in your database with desired values.
This utility automatically selected the connected database.
Put the URL of your live site in the field to replace.
Put the URL of your dev site in the field to replace with.
Choose the Dry Run option to see what all tables and columns will be affected.
Once you see the results and know what is changing then you the click on Live Run.
Clicking on Live Run will change all the URL of your live site in dev site database with URL of your dev site.
Once the changes are done you can delete this folder.
Hope this will at least resolve the problem of redirection of dev site to live site.
Once the new site is built you can then migrate(move, copy) it to the live site's location. There are some tools out there to help with moving the site you can use once the site is done. Some require a plugin to be installed to do that though. For example magicmigration can be used to move the completed site to a new location (that one specifically doesn't take extra installs). It is also possible to manually migrate the site though depending on the situation and know-how that can be a bit much for some people.
I saw this mentioned before, but I couldn't find an answer.
I just migrated from my staging site to live, using a plug-in All in one WP migration. After a fresh install of wordpress + plugin on the new site, I took the .wpress file exported from staging and uploaded to the new.
Everything was successful, until I was redirected to the perma-links settings area to just save the final changes. However, from then any setting I touch in the perma-links section breaks my site. Any link in front end or back end will automatically download to browser.
After some digging, I found its related to the htaccess page. If you haven't already noticed, I'm new to this. I don't know where to start to test what could be wrong with the htaccess page, so I wiped it clean to at least be able to navigate the site.
Anytime I try to touch any permalinks setting in the backend, it will re-write in the faulty code and I have to go back into the wipe the htaccess again.
The second issue is it's causing any page (besides the homepage) to 404. If I try to preview a page from backend (mywebsite.com/page1) it 404's, and of course front end. Same if I try to create a new page.
Please let me know any other info I can provide. I am open to any suggestions.
Thank you
step 1 export your database then open it in notpad++ then ctrl+f find your website old URL suppose stackoverflow.com/dev and replace it with your live site stackoverflow.com after replacing all URL make save it and make zip again.
step 2 import the database into your site database.
step 3 go to your dev site and download all setup with WordPress now paste the all files into new website directories.
step 3 open wp-config.php file and changes database name username and password.
step 4 open your wp-admin and use the username and password same which one you using for the dev site
step 5 go to permalinks and set it %%postname%%
these are simple steps and I am sure it will work for you. no need to new WordPress installation.
Could provide us with your .htaccess file?
But as someone noticed - problably you don't have mod_rewrite. Contact your hosting company, they should be able to fix your problem
My client has a website built using open cart 1.5. He wants me to create a folder inside of it and make a test website using the existing site. I copied everything from the live site and pasted it inside a folder in the live site. Every link in the test website is similar to the links in the live website.
href structure of the live: href="www.site.com/resources"
href stucture of the test site: href="www.site.com/folder_name/resources"
I noticed that when I clicked on a link in the test website, it redirects me to the live website even though I changed the link's href to something like this: href="www.site.com/folder_inside_the_live/resources".
Why does opencart ignore the /folder_inside_the_live/?
I noticed that the live site has no .htaccess and I am afraid to create one as it might affect the live site entirely.
If OpenCart has an installer, you may wish to check for any config/settings files, where it might have set-up the base for links. Reading this OpenCart docs page, it looks like these config files are at /filePathToOpenCart/config.php and /filePathToOpenCart/admin/config.php. Have a look at those, and see if they contain anything that could help. They are most likely just storing database names/passwords, but it is probably a good idea to check it anyway.
I have my wordpress installation at /var/www/html/wordpress2 and there's a totally separate wordpress installation at /var/www/html/html/wordpress.
When running the worpdress2 installation, I get errors saying it can't find /var/www/html/wordpress/wp-content/theme/.... How do I change it to look for these things in wordpress2 and not wordpress?
Did you transfer wordpress to Wordpress 2? If so you need two separate databases, one for Wordpress and the other for Wordpress 2. Then you need to check the wp_options table to have their correct subfolder in the site URL and home URL.
Follow these steps in order to transfer your WordPress site from one location to another.
Change the option_value(your root url of current wordpress site) corresponding to id(value 1) and option_name(value site_url).
Access your wp-admin(siteurl/wp-adimn). Go to general-setting panel and change Site Address (URL), same as WordPress Address (URL).
Hope this will work for you. Same process you can follow to move WordPress site from local to server or one server to another.
We built a website for a client using Wordpress. We used a testing server which always works well. Wordpress was hosted as a subdomain, i.e. http://wordpress.ourcompany.com. I have direct and full access to the server. In the etc/apache2/sites-available directory the file describing the site in question uses the final name http://clientsite.com as ServerName, our temporary subdomain (under which we have been building) is a ServerAlias.
When we were almost ready, we of course asked the client (who already had a website) for their domain login. We changed the DNS like always. It resolved, the site worked well. Although Wordpress kept redirecting (of course) to the subdomain-variant, we could enter the site with the full domain.
Now comes the culprit. I changed the Wordpress settings (siteurl and home) to match the new site. The front-end works brilliantly. However, the back-end is unreachable as long as the settings are in this way. The login page shows up, but just redirects back to itself. If I simply change the Wordpress settings (in the options table) I can log back in, but we want to rid the subdomain necessity (of course).
Things I've already tried (I'm not one to easily ask of your time):
Clear .htaccess
Clear my cache & cookies
Different computer, different browser etc.
Change only the home and not the blogurl value. Sadly, this corrupts some plug-ins
Remove all plugins
Comment some lines as instructed in the wp-login file
Naturally, everything I could find on codex.wordpress
Set the admin cookie path
So, brilliant collective mind that is Stack Overflow, what did I do wrong? DNS? Wordpress settings? Thank you in advance.
You need to go into the settings on the live server and change the URL's to the current site. You'll have to do this by accessing the database directly. It's the wp-options table, and there are 2 entries where the url's are the value. Update those. That should fix the looping.
I found an answer today : the user in the database didn't had the right permissions. You can look up in the error log if there are lines that indicates this.
I also had tried before : removing all content from htacess, reinstalling wordpress etc.