oompahloompah Posted October 15, 2004 Posted October 15, 2004 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. Quote
borfast Posted October 15, 2004 Posted October 15, 2004 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. Quote
oompahloompah Posted October 15, 2004 Author Posted October 15, 2004 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? Quote
TCH-Bruce Posted October 15, 2004 Posted October 15, 2004 You would have to open a support ticket with the help desk and explain what you wanted to link. They would be the only ones that could create a symbolic link. Quote
borfast Posted October 15, 2004 Posted October 15, 2004 Well, the idea of using .htaccess with some mod_rewrite rules just came to my mind but I'm not sure it it's possible... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.