Homepage not loading, all other pages loading in WordPress migration - php

Nobody has had this problem yet it seems.
I just migrated a small WordPress website from my test server-space on iPage over to a client's server on HostGator and while I am logged into WordPress on the new server - the website shows up fine, but if I clear my cache and come on as a new user (as my boss did) they find the silly 2014 theme with no content. But if they go to a specific link it loads fine and then so does the homepage.
I have searched this topic extensively but found nothing. I have tried other migration problems' fixes such as:
adding a new php.ini
uploading new indexes to the root dir and theme dir
saving permalink settings again, and then changing and saving again
updating WP version
deactivating plug-ins
changing .htaccess lines
Why was it working perfectly on the old server location but not the new?
Y'all are my last resort. Is there some sort of cache error (or normal activity that needs overriding) going on? .htaccess? index.php? Is it HostGator's servers maybe?
Please help!
UPDATE: A combination of changing the site/home url in WP_Options and re-saving the permalinks fixed this issue for me.

One of the reasons why wordpress urls contained in the BD pointing to the url old, running this script in phpmyadmin can solve:
UPDATE wp_options SET option_value = REPLACE(option_value,'old_site','new_site');
UPDATE wp_posts SET post_content = REPLACE(post_content,'old_site','new_site');
UPDATE wp_posts SET guid = REPLACE(guid,'old_site','new_site');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,'old_site','new_site');
Also exist the possibility that your hosting account contains a folder with your username, in the wp_options table may be included, for example upload_path: /home/[folder_old_id]/public_html/wp-content/uploads
UPDATE wp_options SET option_value = REPLACE(option_value,'folder_old_id','folder_new_id');

The behaviour you describe is not what I am seeing "But if they go to a specific link it loads fine and then so does the homepage.":
I get the same result following a home link as typing the URL so this is simply a configuration issue
Try this:
rename any .htaccess files .htaccess.temp
look directly in the wp_options table in the database to make sure all entries are correct
review the $site_url in php.ini
taking your test environment offline
This will eliminate most (all?) of the possible reasons your site is not behaving.
Good luck!

Hey I faced the same issue.
If you have just copied the Wordpress files for the mogration, check if you have copied the index.html file from your local site to your production site and delete it. This should fix the issue.

I actually ran into the same/ a similar problem. Homepage didn't work but subpages did. I solved it by looking through my files on the server (FTP) and renaming a mysterious "index.htm" to "index.htm.temp". Turns out wp took this index.htm as the default file for my landing page. Renaming and later deleting it solved the issue.
My website was migrated using the WP Duplicator PlugIn.

Well, if you consider your problem something someone "wants" to do, then you'll find a lot of resources... for example:
https://wordpress.org/support/topic/using-a-different-wordpress-theme-for-a-single-page
Apparently you can create a page template and have the template load a different theme then all the other pages on the site. You can theoretically have every page on your WordPress install run a different theme.
Check things like home.php, front-page.php and what not to see if the homepage is running a template.

Related

WP-Admin redirects to old URL (after editing config.php)

I am trying to get a client's WordPress site copied over to my company's server to use as a development site. I've ran into an issue when trying to log into the site's administrator panel; it redirects us to the existing site's URL instead (ending up as [OLD SITE]/[NEW URL]/wp-admin). Additionally, trying to go to any page other than the homepage gets a 404.
I've tried editing the wp-config and defining the WP_HOME and WP_SITEURL there, with no success. In a previous attempt we used a backup tool that was meant to replace references to the old URL with the new URL, and on another we ran queries and checked through wp-options in the database to be sure that we caught all of the old references. Still redirects to the old site.
We've tried restoring from two backups, Akeeba and BackUpWordPress. Our current attempt is a copy we've downloaded directly and then uploaded (with an imported SQL backup).
Another odd thing I've noted is that changing one of the URLs in the database causes more issues. Mainly, if I update the URL of 'wordpress-https_ssl_host' in the wp-options table, the theme breaks. Not sure where to go with this from here.
I'm always succesfully using the following script : search & replace:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
in order to update a wordpress site url.
Just copy the provided code in a directory under your site, then launch the provided index.php in a browser: the database infos should be automatically determined. Then specify the old and new urls and click on "Run" !
Don't forget to remove the created directory afterwards.
For solving this issue you have to change siteurl in database wp_options table
option_name = siteurl where
option_value = YOUR OLD SITE URL
change your old site url and update it with your local developement site URL
Hope this will help you..
We found the problem; as it turns out it was nothing to do with anything from the default WordPress files. The client was using an extension called WordPress HTTPS, and apparently that was causing a conflict somewhere. We renamed the extension's folder to disable it and everything ran fine. I imagine it was overriding what we were setting in wp-config.

Moving Wordpress pages from subdirectory to root

Beginner mistake, but I've created all my new pages for my Wordpress site in a subdirectory to my original site, and now I wish to move all the pages I've made to my root directory in order to sort the URL to my website.
At the moment my new pages are stood in
www.mysite.com/wordpress-4.6.1/wordpress/
when I enter my site via browser. I've looked around here for advice and tried all that I can find, but nothing seems to solve my problem for some reason. I've tried to change the URL explicitly under the Wordpress general settings but that just crashed my website somehow, so I had to redefine WP_HOME and WP_SITEURL in wp-config.php in order to get it up and running again. I've since tried downloading .htaccess and index.php and changing a few lines in index.php and then placing them in the database root.
The problem I'm left with now is that when I set the URL explicitly in wp-config.php I can't change it under 'General Settings' in Wordpress anymore, and if I state the URL that I want explicitly in wp-config.php the site stops working.
What would you guys suspect is the culprit here? Why is it that I can't change the URL explicitly and get it to work, are there some database-stuff that's still pointing at my wordpress folders or do you think it's something else?
Sorry for the wall of text, but couldn't seem to formulate it any shorter. Immensely thankful for any help!
This is covered in the Wordpress documentation: https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
You will need to change the URL on option table of database.
I managed to work it out! Since I couldn’t edit the Wordpress URL and Site URL directly in Wordpress I had to add this code to wp-config:
define('WP_HOME','http://mydomain.se/wordpress-4.6.1/wordpress');
define('WP_SITEURL','http://mydomain.se/wordpress-4.6.1/wordpress');
I assumed that I had to remove the /wordpress-4.6.1/wordpress from the WP_SITEURL since the “Site Address (URL)” is what I would have changed in Wordpress if it had been possible. Since that didn’t work I removed the subfolders from WP_HOME URL instead and left them on WP_SITEURL and that solved the problem!

Migrating Wordpress to a site with a subdirectory

I've migrated many Wordpress sites before, but now I'm having an issue I just can't seem to solve. Some, but not all of the links are not loading properly.
I'm migrating from local.dev to example.com/test.
In my database options, I have both options set to example.com/test.
I doubled checked the options in the WP backend, and they're example.com/test.
I've updated my permalinks.
All of the pages work, all of the links work, but a few references to images, etc do not - they're loading example.com/ instead of example.com/test.
I think it might have to do with the .htaccess file, because I can't update it from the FTP side. If I delete it and update permalinks, no .htaccess file is created. I don't have access to any server side overrides, only the files.
In my MAMP vhosts, I have SymLinks Override set to All, but I can't edit anything like that on the live host.
The links that aren't working are along the lines of $image = get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
but instead returns
http://www.example.com/wp-content/uploads/image.jpg.
Using bloginfo('wpurl'); returns http://www.example.com/test, and all similar ones return properly (site_url();, 'template_directory', etc.
In the end, the site is going to go on http://www.example.com without the subdirectory anyway, but I'm sure I have to get it to work properly to prevent future errors.
I also updated to the newest version of Wordpress at some point, not sure if that could cause any issues.
I believe the issue deals with media and links placed in content items.
I use to do some manual SQL queries to fix this but now I run this plug-in https://wordpress.org/plugins/automatic-domain-changer/
The plug-in will go through all the content and make the needed changes.
The links that aren't working are along the lines of $image => get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
this meta information is stored in the DB. then to make the migration you have to change all the old URL in the DB before to import it in the new place

WP migration, can't login to WP admin

I was in the middle of migrating a local WP site to a live server and came across a problem.
I edited my WP config file and uploaded it along with the rest of the WP files. I also uploaded the mysql database through phpMyAdmin.
Once i tried to test the site i got an error message "The page isn't redirecting properly". I then, mistakenly, logged in to the admin area and in the Settings > General tab I deleted the localhost part of the URL. Now I'm unable to log back in to the WP admin area.
EDIT
To clarify, my major problem is that i can no longer log in to the wp admin area because of something I've done. The steps i took to get to this point were:
Backed up WP using the BackUpWordpress plugin
Edited back up wp-config file with define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');
Created mySQL database through DreamHost
Changed database info in wp-config file
Uploaded wp files (not including mySQL backup) to my url using Filezilla
Imported mySQL database backup to DreamHost
I then checked the site from my browser, an error message said too many redirects occurred
From the wp admin area i went to Settings > General and deleted the localhost part of the url that was displayed.
I believe it's due to the previous step I'm now unable to access the wp admin area at all.
I need a way of getting back into the admin area
You can also edit those options within phpMyAdmin. Go to wp_options and locate siteurl and home. Make sure the URL matches your site URL.
You can also edit the site URL in your wp-config.php.
Add these lines somewhere above the /* That's all, stop editing! Happy blogging. */ line.
define('WP_HOME','http://my-site.com');
define('WP_SITEURL','http://my-site.com');
This should overwrite your database settings.
I believe the problem is that studiomed.co.uk is permanently redirected (301) to www.studiomed.co.uk and www.studiomed.co.uk is permanently redirected (301) to studiomed.co.uk
Login to your Dreamhost account go to Domains->Manage Domains and choose one of the three options there are in "Do you want the www in your URL?".
After that use an ftp program to download the .htaccess file that exists in your root installation of wordpress and open it with your favorite editor. Check if you have any kind of redirection in the .htaccess file.
Which version of WordPress do you use?
Can you list the plugins you are using?
Have you gone through the basic WordPress troubleshooting steps?
flush any caching plugins you might be running, as well as server
and/or browser caches.
deactivate all plugins to see if this resolves the problem. If this
works, re-activate the plugins one by one until you find the
problematic plugin(s). Sometimes, an apparently inactive plugin can
still cause problems.
If you can't get into your admin dashboard,
try resetting the plugins folder by FTP or PhpMyAdmin (read
http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F
if you need help).
switch to the Twenty Eleven theme (depends on your WordPress version) to rule out any theme-specific problems.
If you can't log in to change themes, you can remove the theme folders via FTP so the only one is twentyeleven. That will force your site to use it.
manual upgrade. When all else fails, download a fresh copy of the latest.zip file to your computer, and use that to copy up. You may need to delete the wp-admin and wp-includes folders on your server. Read the Manual Update directions first: http://codex.wordpress.org/Updating_WordPress#Manual_Update
check the Master List to see if you're experiencing a known issue
Login to your wordpress dashboard (wp-admin) and go to Settings->Permalinks, select Default and save changes.
Update all urls(path) using this querys then check:--
Use this querys for change all urls(path) for db then check
UPDATE wp_options SET option_value = replace(option_value, 'http://live_ste_path.com', 'http://localhost/local_site_path') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://live_ste_path.com', 'http://localhost/local_site_path');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://live_ste_path.com','http://localhost/local_site_path')`
[WSOD RESOLVED]
Since I could not find any solution to my problem by googling around, a crucial tracking info I finally found in WP error logs. So I would recommend to inspect logs before spending to much time looking for a proper answer by google.
After migration from an old web host to a new one, in my multisite environment all sites were working. Also, I was able to administer all subsites - but one! Trying wp-admin login to that site led me to fatal white screen. Without any message or any indication about the reason. And the culprit was corrupted file /public_html/subsite-x/wp-admin/admin.php. I really could not understand how that happened, just might suppose it appeared somehow while transferring files (FTP) from old host to a new one.

Wordpress page suddenly blank

I have a WordPress website that's been running for almost two years now. All of a sudden, it started to show a blank page on any public page. The admin part on /wp-admin is still working without any problems.
A http request is successful (status 200), but the returned content is completely empty (not even an tag).
I'm not really a PHP/WP expert. A simple web search got a lot of results, but mostly old stuff and never any clear conclusion of the problem's source, i.e. how to fix it. I already enabled WP_DEBUG in wp-config.php, but this only shows debug messages in wp-admin, but the public page remains blank.
Where should I continue searching?
The problematic website is http://lolkitten.org/.
Update
I just found index.php inside my public_html, which was empty. After writing something into it, it appears on my home page! Also, there's a directory /home/<user>/home/<user>/public_html/ which looks like complete nonsense to me.
Update 2
The Problem solved itself after upgrading to Wordpress 3.8. I don't know why, but it seems like some files (like index.php) were messed up and got replaced by fresh ones in this update.
Possible solution / workaround
I've had this problem again. This time, my index.php was completely empty. In my dashboard, under Dashboard > Updates, I clicked on Re-install Now and it fixed itself.
Most likely the wp-content folder can’t be found. When you login to the admin does it state that the templates can’t be found in red text in the center of the page right when you login?
I recommend going into your wp-config.php and adjust—or add—the following constants:
define('WP_SITEURL', 'http://lolkitten.org');
define('WP_HOME', 'http://lolkitten.org');
define('WP_CONTENT_DIR', '/path/to/your/wp-content');
define('WP_CONTENT_URL', 'http://lolkitten.org/wp-content');
Fairly confident that the key to fixing this will be the WP_CONTENT_DIR setting. You need the full path to the directory in the file system to your wp-content folder. So if you have a standard Unix setup with lolkitten.org in it’s own directory that path would be:
/var/www/lolkitten.org/wp-content
And the WP_CONTENT_DIR value would be:
define('WP_CONTENT_DIR', '/var/www/lolkitten.org/wp-content');
EDIT Adding info on how to determine your script’s absolute path if you do not have SSH access to the server, but have FTP access of some sort. Just FTP to the server & create a test file called test.php and just put the following code in it:
<?php
echo dirname(__FILE__);
?>
Now load that into your browser to get the full path:
http://lolkitten.org/test.php
__FILE__ is a magic constant in PHP that will echo the full/absolute path of a PHP script.
try deactivatinhg all the plugin once.
And if you can not access admin panel do the following to deactivate plugins
In the database - wp_options table
change the entry to a:0:{} on option ID 35- active_plugins
As far as i see error, it is because of share-buttons plugin.
Try removing share-buttons plugin from plugin folder and then check again.
If still problem exists then remove all active plugins and check again.
I too had same issue and it was because of plugin. I deactivated plugins one by one and my site was recovered from crash.

Categories