Can't see images in WP after domain change

Status
Not open for further replies.

harp21649

Member
Prime Account
Messages
35
Reaction score
0
Points
6
I changed my domain from tf.x10.mx to theforestappb.org and now I can't see any icons, images or graphics in either WordPress Admin or the main site. I did all the changes to mysql using phpadmin following instructions changing all instances of tf.x10.mx occurring and replacing them with theforestappb.org but the problem remained. I have been reading here and other sites via Google search trying to remedy the problem with no luck. I checked my htaccess and couldn't find any problems there and tried all the workarounds I found searching for a solution. Before I posted this, I installed WordPress to a new directory to see if it was some problem other than me missing something and I found the images, icons and graphics are not showing in this new install done earlier as well. I read where it might me an open basedir problem, but I have no idea. I have warning messages such as these on every image in my media directory: "Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/:/tmp) in /home/bhamm/public_html/wp-includes/functions.php on line 2060" I have many more errors I can paste in a post if any needs to see more. I have changed my 'Settings >> Media >> Store uploads in this folder: /wp-content/uploads' from the original setting and the one of the new install that I left the same: '/home/bhamm/public_html/wp-content/uploads' as when viewing an image link via html view in edit a post in wp-admin I saw the image url was: 'http://theforestappb.org/home/bhamm/public_html/wp-content/uploads/image_name.gif'.

I am at a loss after having read hundreds of posts with none solving the problem. I appreciate you taking the time to read and hope someone can solve or tell me how to solve the problem. My site is pretty much out of it at the moment and it might not look like much work but there is a ton of research involved in it. Thank You.

My Primary site: http://theforestappb.org
My test site I did today: http://theforestappb.org/wp

Regards, Bill
 

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
Please try 'wp-content/uploads' as that should be the default, not '/wp-content/uploads' nor '/home/bhamm/public_html/wp-content/uploads'.
 

Anna

I am just me
Staff member
Messages
11,752
Reaction score
582
Points
113
Do note that wordpress uses the configured domain as base for all links, including image paths and stylesheet paths. Did you also update the wordpress configuration to reflect the domain change?
 

harp21649

Member
Prime Account
Messages
35
Reaction score
0
Points
6
@calistoy, thanks for the response, yes I have tried both with and without the slash and then flushed browser cache. Still no change, keep in mind I did a clean install of the test wordpress after I had exhausted what I could find online to see if the problem existed in the clean install, I haven't changed anything in the clean install, but only wrote a post with pictures to test. The site is functioning alright except for the error messages and lack of images and icons on admin and main site.

@Anna, thanks for the response, yes I updated the configuration and searched the database replacing all instances of old domain (tf.x10.mx) replacing them with the new domain (theforestappb.org) per instructions on how to move wp to a new domain. I also changed all instances of old domain in the theme templates, wp-config.php, robots.txt, sitemap.url and htaccess, flushed browser cached between each try and restarted the browser with no change. I have also rebooted my system several times even though I didn't see any reason to have to do so, to make sure I had cleared any system cache that might have been causing the problem to remain.

The problem I am having as far as I have been able to understand, though it might be incorrect, could be one of a security nature of server. Again, I'm not sure, but that is the only reason I have found so far that others have had after exhausting all the steps I've already taken and still having the problem. I have even tried removing my htaccess, flushing the cache and retrying only to find the problem is still there. Also keep in mind I did that clean install of wordpress in the wp directory yesterday after spending over a day trying to solve the no graphics problem to see if it was anything I had missed configuring and the identical problem exists on the new install.

I will also inquire at the site I purchased the domain name and see if they know a solution as well. But I have literally went through my sql database 4 or 5 times and templates and various php files several times as well. I am unable to find any instances of the old domain name in anything at the moment, but it is possible I have missed something not mentioned in all the howto's I have read, which are many, but basically the same thing explained differently.

Regards, Bill
 

Anna

I am just me
Staff member
Messages
11,752
Reaction score
582
Points
113
Took a quick look in your cPanel. You have hotlink protection enabled, allowing only your OLD domain to access images.

Should work fine if you update that as well to the new domain.
 

harp21649

Member
Prime Account
Messages
35
Reaction score
0
Points
6
Sorry for that Anna, I had this in my htaccess and thought it was sufficient:

# WPhtC: Protect .htaccess file
<files ~ \"^.*\\.([Hh][Tt][Aa])\">
order allow,deny
deny from all
</files>

# WPhtC: Disable image hotlinking
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?theforestappb.org/.*$ [NC]
RewriteRule \\.(jpg|jpeg|png|gif)$ \\\"-\\\" [NC,R,L]
</IfModule>

I manually removed the above, disabled the plugin that allows access to htaccess made the file 777 but I still have the same settings in cpanel. Sorry I didn't check cpanel as I thought the above entry was sufficient, but I see it wasn't apparently. I am unable to change the url values in cpanel I get this message when trying to disable: "Error: while opening /home/bhamm/public_html/.htaccess Hotlink Protection Disabled! -- and this error if I try to change (http://tf.x10.mx/http://www.tf.x10.mx) to (http://theforestappb.org/http://www.theforestappb.org) putting the individual urls in the proper fields: "There was an error while enabling hotlink protection. Show Details -- Error: while opening /home/bhamm/public_html/.htaccess

The values are unchanged even though I have htaccess set at 777 when I do it. I am now setting htaccess back to 644 and the above htaccess code is still removed. I still can't see graphics of any kind. I quess I should have taken care of the cpanel before I changed domain names?
 

Anna

I am just me
Staff member
Messages
11,752
Reaction score
582
Points
113
For some reason the .htaccess in your account had root as owner. Further more public_html had the wrong file permissions set, that one needs 750 to work.

Both problems should be sorted, and the hotlink protection adjusted accordingly to work with your new domain.
 

harp21649

Member
Prime Account
Messages
35
Reaction score
0
Points
6
Thank you ever so much, it is working like a charm now. I don't remember changing public_html, but if it was changed I must have done it. I don't believe in Gremlins in systems, I have saved all these notes to a pdf file for future reference, but I think this has all been burned in my mind sufficiently to remember, I feel like my eyes are bleeding from all the reading I've done over the last few days. I will continue to read about servers, especially here and try not to repeat what can only be called stupid errors.

Regards, Bill
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
For some reason the .htaccess in your account had root as owner. Further more public_html had the wrong file permissions set, that one needs 750 to work.

Seems to be caused by the suspension/unsuspension system.
 

harp21649

Member
Prime Account
Messages
35
Reaction score
0
Points
6
Thank you descalzo for the explanation. I try to read, but I see I haven't even begun to read to understand it adequately.
1. I have learned when doing something such as relocating wp don't just assume that the instructions you have are complete just because they come off of the software site.
2. Keep records of everything you do as far as configuration to your site.
3. Read till your eyes bleed everything you can find that's related to what your doing, take notes and check them out before you execute the move even if you have no recollection of changing something, it only takes a moment to look, but it might takes hours resolving a problem that would not have happened if you did look.
4. I am sorting through all the howto's I read and am going to make a checklist in order to have on hand if I ever change domains again.

Again thanks for the patience and the wonderful help I have received.

Regards, Bill
 

harp21649

Member
Prime Account
Messages
35
Reaction score
0
Points
6
This issue is resolved, thanks for all the help. All of you are the greatest... :)
 

Anna

I am just me
Staff member
Messages
11,752
Reaction score
582
Points
113
Closing thread to mark as resolved.
 
Status
Not open for further replies.
Top