0

I recently transferred my wordpress site alphamensquad.com from inmotion hosting to Godaddy. I copied all my files to the new host and created new database with the same name and imported all the tables.

After doing all this my site would not load. I contacted my hosting provider and they asked me to change the nameserver and IP. After that the website started working.

Now when I open my website, the site returns a 500 error. But when I refresh the page, it loads normally. None of the internal pages works. All of the returns Error 500 even after refreshing several times.

I checked the error logs and found several entries like below.

[Sun Aug 06 04:02:48.803764 2017] [core:crit] [pid 16519:tid 140421072078592] (13)Permission denied: [client 173.245.50.237:22637] AH00529: /home/username/public_html/alphamensquad.com/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/username/public_html/alphamensquad.com/' is executable, referer: http://alphamensquad.com

The file permission of .htaccess was 644 and I even tried changing it to 755. The file permission of the folder /public_html/alphamensquad.com/ was 750 and I tried setting it to 755.

I even tried deleting all the content from .htaccess except for the following

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Since none of the subpages are working, I am not able to log into my wordpress account as well.

Please help.

ADC
  • 11
  • 1
  • 3

2 Answers2

2

There are a few things that could be going wrong here.

From my experience here are some of the things to consider.

  • Htaccess
  • File / Folder Permissions
  • PHP URL Mod_rewrite
  • Website URL in the WP_options table

Here are some steps you can take to try and fix the above.

Htacess

Delete and recopy the .htaccess file from old to new server. I think you have already tried this so this probably won't help you.

File / Folder Permissions

This is very likely the cause of your problems. Wordpress will fail to load if some of the folders have the wrong permissions. This link will give you some more information on the permission problems. Correct file permissions for WordPress

Here are some commands you can run if you have root access in order to fix the problems.

chown www-data:www-data  -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \;  # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \;  # Change file permissions rw-r--r--

This plugin can also be used but that won't help you if you can't log in. https://wordpress.org/plugins/wp-file-permission-check/

PHP URL Mod_rewrite

Make sure Mod_rewrite is enabled on the new server that you are using https://za.godaddy.com/community/Managing-Web-Hosting/mod-rewrite-module-NOT-loaded/m-p/6318#M5216

Website URL in the WP_options table These mysql queries will help fix any references to the old website.

UPDATE wp_options SET option_value = replace(
    option_value, 
    'old-website-url.com', 
    'new-website.com'
) WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(
    guid, 
    'old-website-url.com', 
    'new-website.com'
);

UPDATE wp_posts SET post_content = replace(
    post_content, 
    'old-website-url.com', 
    'new-website.com'
);

UPDATE wp_postmeta SET meta_value = replace(
    meta_value, 
    'old-website-url.com', 
    'new-website.com'
);

If all else fails

You can try using a plugin to do the transfer.

https://wordpress.org/plugins/all-in-one-wp-migration/

Mark
  • 373
  • 2
  • 11
-1

My dude...easy...RESET PERMALINKS : )