Jump to content

Recommended Posts

Posted

How do I maintain image links across subdomains using relative URLs?

 

Is there any other way apart from using base href or typing the full URL? I understand that using base href may be an inefficient way of coding as this would turn all my links into absolutes.

 

For example,

img src = "/some-folder/some-picture.gif"> would not work for a subdomain

if the full path for /some-folder = /../public_html/some-folder

 

Is it possible to create a symlink on our home directories? How do I go about doing it since there's no shell? Also, would this affect the performance of page loading in any way?

 

Thanks, it would be really helpful to know.

Posted

I think your best option is to use absolute URL's. Why do you say it would be an inefficient way of coding?

 

The only other way I see is for you to use "../some_folder/some_picture.gif" but that is what I consider inefficient, because if you want to move the directory where that HTML file is one level deeper in the directory tree, the image link will no longer work.

Posted

I agree... the ../some_folder way does seem inefficient.

 

I would like a central resource to be accessed via a root-relative URL that would work on multiple subdomains eg thisplace.****/resource/ would point to the same folder as anotherplace.****/resource/ or in other words, doing a src=/resource/ would work across subdomains.

 

Is there any way this can be done? If possible, I would like to maintain my root-relative URLs to be the same and in as concise form as possible. Long and wieldy coding is personally in my opinion visually inefficient. I don't think and don't know of any performance inefficiency though between the two formats.

 

I guess a symlink cannot be done via ftp or the cpanel?

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...