Solved

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

Posted on 2004-09-08
10
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 125 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Assisted Solution

by:wobbled
wobbled earned 75 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 50 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

749 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