Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
March 13, 2010, 11:19:36 PM

Pages: [1]   Go Down
  Print  
Author Topic: Images not showing in main website  (Read 373 times)
SJ
Intergalactic Superstar
*****
Offline Offline

Posts: 134


« on: June 23, 2009, 12:37:56 PM »

Hi, please can someone help.

My image files are not showing throughout my site (although I am sure it was all ok yesterday  Confused)

Can anyone tell me what the image path should be

The images are stored at public_html/templates/default/images
and also:                      public_html/images

I have tried all the following paths to get the images to show but it is not workin
g

<img src="http://www.mysite.com/templates/defaultb4u/images/blue_small_hor.jpg">
<img src="templates/defaultb4u/images/blue_small_hor.jpg">
<img src="{$image_dir}blue_small_hor.jpg" width="22" alt="" />
<img src="images/blue_small_hor.jpg" width="22" alt="" />

Please can someone help, perhaps there is something else I need to do elsewhere ?

Thanks
Logged
Mitch
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 12683


Business Development Specialist at Lunarpages


WWW
« Reply #1 on: June 23, 2009, 01:07:30 PM »

Is there a way you could give us a live example?  Also, have your tried to type in the direct path via the browser's address bar to see if it will come up that way?
Logged

New Lunarpages Contest! - Win a Free Web Site Design! Enter Today!


Mitch the Moderator - follow me @lunarpages on Twitter!
Important Threads: Read This Before Posting! | Lunarforums Rules! | Mitch's Link of the Day!
Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !

Need Web Hosting Help? Check out the Lunarpages Web Hosting Wiki. It has tons of tips, tutorials and resources!
SJ
Intergalactic Superstar
*****
Offline Offline

Posts: 134


« Reply #2 on: June 23, 2009, 01:37:37 PM »

When I type in http://www.mysite.com/templates/default/images/blue_small_hor.jpg in the browser the image does come up but when I put this in my file

<img src="http://www.buddies4you.com/templates/defaultb4u/images/blue_small_hor.jpg" width="22" alt="" />

This image is not coming up on my site ?

Any ideas please what the problem is ?
Logged
MrPhil
Professor in Nanotechnology
*****
Offline Offline

Posts: 4583



« Reply #3 on: June 23, 2009, 02:32:25 PM »

Decide whether you want directory default or defaultb4u. Where are the images? Are they on your site or are you hotlinking from someone else's site? What is this second images directory (/images) you mentioned? Are your images found in a different domain than the one you're working in? Are there any subdomains or add-on domains involved here? If so, do you have hotlink protection enabled (and failed to whitelist all your domains)?

<img src="http://www.mysite.com/templates/defaultb4u/images/blue_small_hor.jpg">
---> You don't need http://www.mysite.com if this is on your own site. Is it "default" or "defaultb4u"?

<img src="templates/defaultb4u/images/blue_small_hor.jpg">
--->  Works only if "templates" is immediately below whatever directory you're in at the time. Otherwise, "/templates" should work wherever you are. Again, "default" or "defaultb4u"?

<img src="{$image_dir}blue_small_hor.jpg" width="22" alt="" />
---> Only for PHP code, when variable $image_dir is something like "/templates/defaultb4u/images/".

<img src="images/blue_small_hor.jpg" width="22" alt="" />
---> Only if "images" is immediately below whatever directory you're in at the time.
Logged

Matthew Alan
Jabba the Hutt
*****
Offline Offline

Posts: 738


« Reply #4 on: June 23, 2009, 03:56:24 PM »

Posting an example link will help alot. To check your source or see if it's a local problem.
Logged
SJ
Intergalactic Superstar
*****
Offline Offline

Posts: 134


« Reply #5 on: June 24, 2009, 04:29:02 AM »

Hi, thank you very much for your replies, this had led me to go through it with a fine tooth comb and now I have managed to get the images showing on my main site, so panic over for me....thank you.

But I dont know if this is the correct way to do it, and I like to know it is set up right, and just thought I would show you what I did to see if you have any comments.

I have 2 subdomain websites which both run off the same script, the images work OK using (what came with the script) <img src="{$image_dir}blue_box.gif"  alt="" /> and the images are stored at public_html/templates/default2/images.

Main Site
Top level public_html

Images will ONLY show if I put them in the public_html/Images folder (NOW the SAME level as the templates folder not within it).      I also had to change the paths in the files to be <img src="images/blue_hor2.jpg"> in order for them to display correctly.   

I am happy to leave it as it is.  But if this is not the correct way it is always nice to know.

I expect sub-domains will run off different paths etc, but I wondered if I might need to change something in the config file or htaccess.

Anyway, thanks again for your help.

 Luff Ya

 
Logged
MrPhil
Professor in Nanotechnology
*****
Offline Offline

Posts: 4583



« Reply #6 on: June 24, 2009, 02:48:40 PM »

"images" and "Images" are two different directories (not the same thing)

You main site, all subdomains, and all add-on domains are invisible to each other. Any directory outside the site's own tree (its HTML "/" directory and below) is not seen by a site. You need to use the full http://othersitename/path... for this. Maybe you ran into that?
Logged

SJ
Intergalactic Superstar
*****
Offline Offline

Posts: 134


« Reply #7 on: June 25, 2009, 07:56:03 AM »

Hi,

So I should NOT be using the images folder in public_html (I didnt think I should but it worked), ONLY use the images folder under the sites own directory tree.  

Will this cause problems then if left as it is ?


I just tried the full path as you showed me http://othersitename/templates/website/images and now the images work, so I can now go back and change the paths to the "images folder in the website directory tree" if need be.

Thanks for your help to explain this.

UPDATE: I have just noticed the path http://othersitename/templates/website/images works from pages within the Database but NOT from within the script .tpl files ? cant get any path to work within these files ??

 Very Happy
« Last Edit: June 25, 2009, 08:21:27 AM by SJ » Logged
MrPhil
Professor in Nanotechnology
*****
Offline Offline

Posts: 4583



« Reply #8 on: June 25, 2009, 10:10:49 AM »

I'm not familiar with the templating system you're evidently using, so I'll leave it to someone else to answer your question. As I said, at the HTML level (e.g., <img src="path/imagename">), each primary domain, subdomain, and add-on domain has its own "/" root, and can't see any of the directories or files of the "other guys" (needs the full monty http://othersitename/path/imagename bit). What the templates are doing, I don't know.
Logged

SJ
Intergalactic Superstar
*****
Offline Offline

Posts: 134


« Reply #9 on: June 25, 2009, 10:18:52 AM »

I will look for help at the script forum, may be best place...just wondered if I may have to edit config.php or htaccess to make them appear.

As you said....see if anyone else can throw some light on this.

Thanks again
Logged
angelad
Trekkie
**
Offline Offline

Posts: 19


« Reply #10 on: June 26, 2009, 12:19:27 PM »

I will look for help at the script forum, may be best place...just wondered if I may have to edit config.php or htaccess to make them appear.

As you said....see if anyone else can throw some light on this.

Thanks again

Did you check your permissions by any chance?
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: