pics,graphics & directories
Hello, I'm making a website and trying to layout how I'm going to make it.
My question is for a highly visited site--Is it better to put pics and graphics in their own directories, or put them in the directories where they will be used?
Please keep in mind that I only know basic html--no fancy programming languages. Thanks for any advice you could offer.
Suzanne posted this at 23:15 — 14th February 2004.
She has: 5,507 posts
Joined: Feb 2000
It's better to put them in a logical location. Period.
i.e.
/section/images
/sitedesign/images
And refer to them as that as well -- that way you can put the images anywhere you want without worrying about finding them.
It doesn't matter how you do it as long as you are consistent.
Also, since I'm here:
Absolute by domain: domain.com/images/image.gif
Absolute / Relative to root: /images/image.gif
Relative to file: images/image.gif
Relative to file, other directory: ../images/image.gif
Of these options, the relative to root (also called absolute by some) is the most transportable and least prone to error and duplication. I would recommend it above the other choices.
island597 posted this at 01:30 — 15th February 2004.
They have: 18 posts
Joined: Jun 2003
Thanks Suzanne.
davidjaymz posted this at 14:38 — 19th February 2004.
He has: 193 posts
Joined: Jul 2001
hey.... just to hijack this...
if i'm in
domain.com/blog/index...
and want to link to an image in
domain.com/images
I use ../images/image.gif
what happens if i'm deeper into a file structure? can i ../../ to get two steps back up?
Thanks for any help
DJ
Abhishek Reddy posted this at 14:49 — 19th February 2004.
He has: 3,348 posts
Joined: Jul 2001
Sure can.
Suzanne posted this at 17:52 — 19th February 2004.
She has: 5,507 posts
Joined: Feb 2000
of course, it's easier to not get lost and just code
Then you just need to know where that image directory is, instead of where it is in relation to your file.
davidjaymz posted this at 10:33 — 20th February 2004.
He has: 193 posts
Joined: Jul 2001
so using Quotes ".." will take me back to the root?
The reason i'm asking is because if you go to my blog (davidjaymz.com/blog) everything works and i've used (../) but if you go to blog.davidjaymz.com which is the same blog... the pages show up but no css and no images... is this due to the use of ../ to get out of directories and into other ones?
As always thanks for any and all help
DJ
Suzanne posted this at 16:49 — 20th February 2004.
She has: 5,507 posts
Joined: Feb 2000
yes -- that's why I suggest using /images/whatever as your src, it will prevent things that are in different folders getting confused, especially when you use the same file across different directories!
druagord posted this at 20:38 — 20th February 2004.
He has: 335 posts
Joined: May 2003
no this wont work for blog.davidjaymz.com since your website root does not contain the image folder you cannot go higher up then root on a properly configured server
IF , ELSE , WHILE isn't that what life is all about
davidjaymz posted this at 14:08 — 23rd February 2004.
He has: 193 posts
Joined: Jul 2001
ok... now i am confused... LOL if blog.davidjaymz.com points to the folder davidjaymz.com/blog where does the difference occur?
as always any and all help is appreciated
DJ
Suzanne posted this at 14:45 — 23rd February 2004.
She has: 5,507 posts
Joined: Feb 2000
blog.yourdomain.com is ROOT
yourdomain.com/blog is a sub-directory
The difference is in how you access it. Basically a sub-domain works like a regular domain.
If you have blog.yourdomain.com set up, and you can still access yourdomain.com/blog I would recommend that you a) make sure all your images relating to blog.yourdomain.com are in the /blog/ directory or b) you redirect all calls to yourdomain.com/blog/ to blog.yourdomain.com using the .htaccess file.
davidjaymz posted this at 16:57 — 23rd February 2004.
He has: 193 posts
Joined: Jul 2001
I guess i'm gonna have to double up some of my files then... oh well... if it makes everything work it'll be cool... I'll just have to remember to copy to multiple folders...
As always thanks for the help
DJ
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.