WordPress errors: uploading and 404

0 , Permalink

I’ve been working on a site that requires a WordPress install for part of the site only. I had it working on my server but now it was time to transfer the entire site to the client’s development server. My rookie mistake was that I copied all the WP files over, minus my config file as I would create a new one for them based on their database info (I was not importing anything from my database – starting fresh).

When I logged into the new install of WordPress for the first time, everything seemed ok. It was when I tried to upload an image where I ran into some problems.

The uploaded file could not be moved to (some strange path).

This error message happened when I tried to upload a feature image, so I decided to try to upload to the library. I got an error message saying that there was an error uploading. I decided to check where the media files were supposed to be uploaded to by going into the WP dashboard
Settings > Media. The path was correct (wp-content/uploads). I went back to the FTP and looked at my file structure. Yes, there was in fact and uploads folder, but wait, why was the file I was trying to upload in there already?

I then realized that it was copied over from my server. When I deleted the folder from the client’s server and re-created a new uploads folder, I was able to upload problem-free. I’m guessing this has to do with the owner of the folder not matching, but I’m not 100% certain.

The second issue I encountered was a 404 Not Found issue when I tried to visit a single post. This was a faster fix as my first instinct was to check the .htaccess files. I started at the top level, at the root. The .htaccess file was full of re-write rules, but none of them looked like it would affect my site. I moved on to the .htaccess file I included and that is where I found the problem. My file looks similar to this default WP .htaccess:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

In the second line, I had a path to my WP install on my server, which was different from the one I set up on the client’s server. I simply had to correct the path and presto, everything works!

Comments are closed.