Jump to content

Subdomain Images Path?


Recommended Posts

I have seen a few related posts relative to this subject, yet I still do not understand how to get a page in a subdomain to find images. For that matter, I assume links will be an issue as well.

 

cook.inssar.org was created with cPanel

http://cook.inssar.org/index.htm has images which are not displayed

 

I have tried putting the images in the root cook folder

<IMG SRC="image01.gif">

 

I have tried putting them in a folder cook/objects

<IMG SRC="objects/image01.gif">

 

I have tried accessing images in the main domain's objects folder.

<IMG SRC="../objects/image01.gif"> AND

<IMG SRC="http://www.inssar.org/html_public/objects/ind_flag.gif">

 

I assume there is a simple explanation. Suggestions please?

Link to comment
Share on other sites

If its stored in the same directory(cook) it would be

><img src="images/myimage.jpg" />

If its outside of the directory(public_html) it would be

><img src="http://www.domain.com/images/myimage.jpg" />

or

><img src="/home/public_html/username/images/myimage.jpg" />

Link to comment
Share on other sites

Gentlemen:

 

I have tried all the suggestions in Dick's reply and, still nothing.

 

<img src="/home/public_html/cook/objects/const.gif">

 

<img src="http://www.inssar.org/objects/const.gif">

 

<img src="/home/public_html/cook/objects/ind_flag.gif">

 

<img src="/home/public_html/objects/ind_flag.gif">

 

<img src "objects/ind_flag.gif">

 

<img src "../objects/ind_flag.gif">

 

I have all the images in both objects folders, and the cook.inssar.org root folder.

I dropped the subdomain and recreated. Still no success.

 

I noticed in Don's examples, "/" at the end of the tag

<img src="images/myimage.jpg" />

 

I even tried that.

 

Any other suggestions?

Link to comment
Share on other sites

Where are the images?

in the same folder that represents the subdomain?

remember the subdomain is a shortcut to domain/folder

 

If in the same folder as your pages

<img src="myimage.jpg" /> will work

 

other wise the absolute url

<img src="http://www.domain.com/foldername/myimage.jpg" />

will also work.

 

 

 

edit-------

 

I see you are using relative addressing

<img src="../objects/ind_flag.gif">

try the absolute address

<img src="http://www.inssar.org/objects/ind_flag.gif">

when using in a subdomain

Edited by TCH-Don
Link to comment
Share on other sites

This should work:

><img src="http://cook.inssar.org/objects/ind_flag.gif" />

but doesn't because it gives a 404 error while trying to find the missing 403 error page. So, you need to add that subdomain (http://cook.inssar.org/ and http://www.cook.inssar.org/) to your allowed sites in hotlink protection.

Link to comment
Share on other sites

Don,

 

All good suggestions, but nothing works.

 

Properties (right click on image spot) says:

http://cook.inssar.org/objects/const.gif

 

Absolute path says:

http://www.inssar.org/objects/const.gif

 

I have even set up a second subdomain indy.inssar.org and get the same results.

 

I appreciate your efforts, but sadly, nothing works :)

Link to comment
Share on other sites

Hotlinks protection was in fact turned on. I have added the subdomain to the allow list, and "all is well." :D

 

Prior to changing the hotlinks allow access list, I created a test subdomain on another website, copied the images and html, and it worked, even though the newly created subdomain was (is) not on the allow list ? :)

 

I still do not know why one site behaved differently than the other, but it's all working now and I've learned from the experience.

 

Thank you all for your perseverance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...