?
Solved

Changing base href organized site to a relative path site -- needs to be automated

Posted on 2004-09-08
10
Medium Priority
?
259 Views
Last Modified: 2008-03-10
Hi there,

I am trying to test my entire site for broken links. I know that there are validators out there that can go page by page and then there are the paid services that will check your entire sites. However, I use Dreamweaver (which has a validator as part of the program) so I'd rather use that if I could.

Here's the thing, Dreamweaver ignores my base href and tells me that all the links on my site are broken. I can't find any way around this so I am looking to change my site link paths to relative links not based on the base href. Is there a way to make this transition less painful than I think it is going to be? -- There are ~5200 links to update.

I.e., is there a way to automate this process? I was hoping that Dreamweaver would ask "Do you want to update all your links" when I removed the base href, but no.

Are there any other programs out there, maybe even FTP cute, etal)

Cheers in advance,
paul.
0
Comment
Question by:gooner_paul
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 375 total points
ID: 12011995
Hi

If Dreamweaver ignores base href, I have no idea about how to change it if possible. Below is a site with a methodical way of doing this by hand, and if you find the 4000 links a bit too difficult, you can probably make a macro with something like Macro Express to simplify things.

Regards,
Zyloch
0
 

Author Comment

by:gooner_paul
ID: 12012161
Thanks for the info, Zyloch. You mentioned a site but left no address -- unless you mean the Macro Express guys.

Cheers,
paul.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12012183
Ah, I forgot, sorry, my bad.

http://www.st-petershigh.gloucs.sch.uk/TeacherPages/website/linkchecker.html

For Macro Express, it's a utility that you can make easy macros from. With care of use, you should be able to make a macro that can loop through above site's solution.

http://www.macros.com/
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
LVL 17

Assisted Solution

by:wobbled
wobbled earned 225 total points
ID: 12015978
In dreamweaver just use find and replace under the edit menu.

Put in the start of your  href code <a href= and in replace <a href="www.mysite\etc\

You can then choose the option to change this accross entire site

should make it much quicker for you
0
 
LVL 19

Expert Comment

by:webwoman
ID: 12017269
I'm confused as to why you need the base href in the first place.

Any links within your own site should be relative, and wouldn't require a base href. Any links outside your site should be absolute, and wouldn't require a base href. A base TARGET I could understand.
0
 
LVL 17

Expert Comment

by:wobbled
ID: 12017428
webwoman - base href is a w3.org recommendation.  While it is not really required within modern browsers it can help on some older clients and search spiders.  Check out http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4 for mor info.
0
 

Author Comment

by:gooner_paul
ID: 12019320
Sorry that I have been tardy in responding -- it was a late night and I only just stirred an hour ago.

I'll try and respond to all.

(1.) I chose base href so that I didn't have to worry about moving the hierarchy of the site around in the initial construction phase and messing all the directory level "../../" parts of the path up. However, at the time I started this project I didn't have Dreamweaver, so in hindsight I was stupid to go with the base href as every time you change the sites navigation Dreamweaver auto updates all your links for you.

(2.) As for the search and replace idea -- while I think it is a good one -- it could be tricky as I also have a lot of external links as well as local. Also, aren't relative links easier on server time that absolute links. Will I still have the issue of not being able to use the Dreamweaver functionality of auto update?

yours, still slightly confused,
paul.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12022387
Yes, relative links are faster than absolute ones, but in today's age, it usually doesn't matter.
0
 
LVL 19

Assisted Solution

by:webwoman
webwoman earned 150 total points
ID: 12022854
>>I chose base href so that I didn't have to worry about moving the hierarchy of the site around in the initial construction phase and messing all the directory level "../../" parts of the path up.

If you use a root reference  -- /folder1/folder2/file.html -- it doesn't matter where the files are, they take the path from the defined root of the web.

Search and replace would work fine -- you would be looking for a href="xxx/something.html" and NOT a href="http://... " which would be needed for external links.
0
 

Author Comment

by:gooner_paul
ID: 12023710
Thanks guys. Looks like I have a lot to go on. All good stuff.
0

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question