Solved

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

Posted on 2004-09-08
10
229 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 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now