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

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.
gooner_paulAsked:
Who is Participating?
 
ZylochConnect With a Mentor Commented:
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
 
gooner_paulAuthor Commented:
Thanks for the info, Zyloch. You mentioned a site but left no address -- unless you mean the Macro Express guys.

Cheers,
paul.
0
 
ZylochCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
wobbledConnect With a Mentor Commented:
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
 
webwomanCommented:
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
 
wobbledCommented:
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
 
gooner_paulAuthor Commented:
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
 
ZylochCommented:
Yes, relative links are faster than absolute ones, but in today's age, it usually doesn't matter.
0
 
webwomanConnect With a Mentor Commented:
>>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
 
gooner_paulAuthor Commented:
Thanks guys. Looks like I have a lot to go on. All good stuff.
0
All Courses

From novice to tech pro — start learning today.