 |
 |
Advice on Moving Website
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jul 2003
Status:
Offline
|
|
I have a partially developed website. When I wrote the HTML, I was too lazy to learn the how use relative referencing- so instead I used a universal address every time I made a link. I now realize how important this mistake was as I am trying to move the website to a different server. If I had simply used relative referencing, it would be a simple transfer!
Now I have to go through every page and edit every single link (tons of them) to make it a relative system. Does anyone have any advice on how to cut corners or create shortcuts to help me with this kind of task? Any way to use automator or something similar to make this job less painful?
Thanks for your sympathy and advice. 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jul 2003
Status:
Offline
|
|
I just read my post and realized that it might be a little confusing, as I am probably not using the correct verbage. I'd like to clarify- When I created a link to something, I typed something like: a href="http://www.absoluteaddress.com/" instead of: a href="//subfolder".
Does that make more sense? The example is an absolute reference and the second is relative.
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: Mar 2004
Location: Copenhagen
Status:
Offline
|
|
Actually, I think your second post just confused things
But that's okay, 'cause it's quite clear what you mean in your first post...
I haven't had any monotonous, repetitive tasks to do since upgrading to Tiger, so I haven't really played around with Automator yet, and thus can't help you much there...
However, if you really do have a lot of links that need to be 'relativised', here's what I usually do:
Find all the folders you have linked to in the current page (ie. say you've got links to pages in four different folders on the domain http://www.it.com: one/, two/, three/, and four/), and the page you're currently in is it.com/five/page.htm.
Then just open the HTML file in a simple text editor (or SubEthaEdit, or whatever), and do a search and replace. Just tell it to search for 'http://www.it.com/one/' and replace all occurrences of that with './one/'; and then do the same for the other folders.
Just make sure you've got the correct relative paths all ready, otherwise you'll get your brain tied tightly in a Gordian knot of dots and slashes.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Originally Posted by Oisín
...replace all occurrences of that with './one/'; ...
That would create a relative link from the current folder, which wouldn't necessarily be correct.
I don't see the problem in doing a search and replace for http://www.it.com/ and replacing all occurrences of that with '/' - you still have absolute references (which are not always a bad thing) but it can sit on any virtual domain you choose. Get the free text editor from www.barebones.com if you'd like to simplify searching and replacing through nested folders
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status:
Offline
|
|
Ditto on find and replace through directories. I use BBEdit to do it quite often.
I wouldn't even bother making the paths relative, I'd just plug in the new domain
e.g.
find:
myolddomain.com
replace:
mynewdomain.com
done in one step.
Relative paths are more common because as you're finding out, they're easy; but there's something to be said absolute paths.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jul 2003
Status:
Offline
|
|
Sound advice. Thanks. Good to know others have thought about this... 
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Even if you want to do absolute paths, I don't see any reason to hardcode the domain name rather than using "/" for the site's root directory.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status:
Offline
|
|
I think the OP already understands how to use relative paths, but if he doesn't here's a guide. What he's most interested in is batch processing of HTML; unfortunately I lack good suggestions on that front.
|

"The natural progress of things is for liberty to yield and government to gain ground." TJ
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: Mar 2004
Location: Copenhagen
Status:
Offline
|
|
Originally Posted by Simon Mundy
That would create a relative link from the current folder, which wouldn't necessarily be correct.
Oops, sorry, that full stop wasn't meant to be there. Near-bedtime typso 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|