Quick question (HTML)

Entity

Lifer
Oct 11, 1999
10,090
0
0
I'm restructuring my website so all of my pics are in a separate directory (~/pics). Is there a quick way I can edit all of my HTML files to have them enable this new directory, or do I have to manually edit every HTML file and change the src to "pics/etc.gif"?

Rob
 

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
you can use a tag like this:

<base href=&quot;http://www.alohadeals.com/pics/&quot;>

all of your subsequent links/pics/etc will point to the pics directory, or whatever you put.


nevermind... you'd still have to edit all your page files:(
but that's the key for each HTML page
 

konichiwa

Lifer
Oct 9, 1999
15,077
2
0
You could load up all the pages in notepad and use the Find and Replace feature:

Find: <img src=&quot;whatever.gif&quot;>
Replace with: <img src=&quot;pics/whatever.gif&quot;>
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
I was doing that, koni, but it was tedious. So I tried IB's way. Works well. :p

Rob
 

EmperorNero

Golden Member
Jun 2, 2000
1,911
0
0
I'm still an HTML newbie so correct me if I'm wrong:

if you want to use an base tag, you'll have to put it in the <head> tag and you can only have one base tag per document, therefore all of the relative links (e.g. <a href=&quot;aboutme.html&quot;> ) would have &quot;http://www.alohadeals.com/pics/&quot; in front of it, thus, it would create a messed up link. let's say you have a link in that same document and that link is a relative link, then those links would lead to http://www.alohadeals.com/pics/aboutme.html.

nevermind...ib already addressed the problem.
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
EmperorNero,

Looks like you're right. I'm working on fixing that now.

IB,

Thanks anyway. It was a good try. :) I thought it'd work...it did for the pics, but messed up the rest of the relative links.

Rob
 

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
yea... I only use it on pages with lots of pics (cause it creates extra work for the links)
 

EmperorNero

Golden Member
Jun 2, 2000
1,911
0
0
you can fix it by changing all of your relative links to a full one..but then that would mean going through each of the links again so you might as change all of those picture links.

try allaire homesite (I love it)...PM me for more info ;)
 

EmperorNero

Golden Member
Jun 2, 2000
1,911
0
0
and since we're on the same topic, how do you guys recommend a site's directory should be set up? as of now, I have everything (web pages, pictures, etc) all in one directory in tripod. it's a relatively small site: about 9 pages total.
 

Huma

Golden Member
Oct 10, 1999
1,301
0
0
just do a find and replace (I hope you have a decent html editor, if not go download the allaire homesite demo).

So do a find of <img src=&quot; and replace with <img src=&quot;pics/

The rest of the image name will remain the same and should work fine.
 

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
The way I'm starting to structure my pages/pics is with a dating system. CNN does the same sort of thing on many of there pages. This is for a personal website with on average, an update of family pictures once per week.

For me, I keep my picture files in order, and can easily move them around to a different server by updating the base tag, should I need to.

this month:

www.alohadeals.com/pics/2000/12dec/***JPEGs go here***

next month and each following month:

www.alohadeals.com/pics/2001/01jan/***JPEGs go here***
www.alohadeals.com/pics/2001/02feb/***JPEGs go here***

I need to do the same sort of thing with the pages themselves, but will probably limit to only month:

www.alohadeals.com/2000/***pages.html***


... etc.
 

IBhacknU

Diamond Member
Oct 9, 1999
6,855
0
0
so much for the quick question! ;)

on a more serious note, you may edit your title for those who decide to use the search function in the future? Just a thought :)
 

Huma

Golden Member
Oct 10, 1999
1,301
0
0
the problem with using absolute references rather than relative is that it can add time to the load depending on the speed of the dns resolution. And if you ever want to move the folder, you'd have to redo all the links again.