Solved

Broken HTML links on a MAC but not a Windows PC

Posted on 2014-02-05
15
272 Views
Last Modified: 2014-02-05
I produce a DVD in html format the works on Windows PCs but a few people have had issues on a Mac. I attached an example of some links that are good on a PC (at least in Firefox and IE), but dead on a Mac (I don't know which browsers). The Bad.html file has some broken links, and the corresponding links in the Good.html file work. The text file points out a couple of these. FWIW I use Dreamweaver CS5.
Example.txt
Good.htm
Bad.htm
0
Comment
Question by:orerockon
  • 7
  • 3
  • 3
  • +1
15 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39837078
Spaces in a URL are not valid in any browser, replace then with %20 or do better renaming of your folders/files i.e. use dashes.
Don't know what language you can use but you may be able to this at the server if you are using PHP,.net etc.
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39837079
The only difference I see is that in your "bad" file all the links point to .html files and in the "good" file the links are to .htm files.

HTH,
Dan
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39837087
@Cathal: being a DVD, I don't think it uses PHP, I think it's just static pages.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39837113
Good catch on the htm/html if that is the reason but...
The point is all the url's have spaces in them and they shouldn't - I mentioned (maybe) php or whatever to replace the spaces not knowing how the page is built.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39837422
Not just the URLs but spaces should be removed from All file names including images.  On my own sites, I remove all spaces and all punctuation from file and directory names.  I don't think you can predict what a browser will do with spaces in those names.  IE in some cases converts a space to an underscore '_' just to confuse the situation.  And although Unix/Linux will technically allow almost any character in a file name, the web servers and browsers are much more picky.
0
 

Author Comment

by:orerockon
ID: 39837561
Thanks, I checked several good and bad files and think it's a bit more complicated than that. It doesn't run on the net, you just run the DVD and it opens the index file in the preferred browser.

Spaces in the file and folder names, whether the extension is .htm or .html, make no difference to Firefox or IE, I checked on a Mac and they made no difference there either. I had a customer check on a Mac desktop and a laptop, and a PC, and the links in the "Bad" file worked on a PC but didn't on either Mac. It didn't matter whether there was a space in the name or not. References to some .htm files didn't work on a Mac, but some did. Some refs to .html files worked, and some didn't. All of the links in the "Good" file worked on a Mac. Links on other pages I have tried on a Mac all have spaces in the names with a few exceptions where the images had one word prefixes, and all work.

Thinking it might have something to do with headers that CS5 inserts in everything, I stripped out the entire header of all the files and they still run on my PC but I need to test that on a Mac as well. The only consistent thing I can think of is that all links to other pages work on most pages on the Mac, and some links don't work on some pages. There aren't any pages my customer can find where all links to all pages don't work (not to images, they all work, space or no space in the filename). I'll have to try renaming and sending the bad files to my customer to see if they work.

I've had essentially the same file structure and naming conventions (or lack thereof) for 10 years now, and only recently did anyone complain that some links didn't work on  Mac. I wonder if it has to do with newer flavors of OS X.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39837591
Is it possible you can throw this up online?
The only other thing I can think of that would be different between Mac and Windows is that the HDD on the Mac has been formatted for case sensitivity and if you have some links that have differing case they would be broken...?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:orerockon
ID: 39837619
I created a little test, see the attached.
DVD-Test.zip
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39837638
First obvious thing is you use
Map pages
in the urls but the folder is
Map Pages

In the working page you use
Map Pages
for the urls

I'll refer you my comment above, I'm 99.9% sure this is a case problem
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39837686
Actually it appears that he's not consistent with the case either.  The two main files use different cases to get to the area files.

I'm not currently having any problems with your files.  That doesn't change any of my recommendations though.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39837692
The inconsistency would actually go along with what he is saying in that some links work on some pages and other links don't work.  There is nothing else I can think of that would be the problem but the case.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39837704
This reminds me of the case sensitivity that you can enforce on windows server, is this an edge case where someone is enforcing it on a Mac Server and that is why the links break, but a normal Mac OS install would not be case sensitive.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39837709
I just loaded your demo on my Linux server which is Always case sensitive.  The Whitebird link in the Idaho page fails because the word 'pages' is lower case and the directory is uppercase.  The Nehalem River link in the Oregon page does work because it is the same case as the directory name.  

Macs seem to be kind of funny sometimes.  The underlying OS is based BSD Unix but they try to be the best of all worlds.  I know that in some cases they are case sensitive and sometimes not.  I don't know what their rules are for that.

The 'cure' is to always be consistent in your case in names.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39837716
Macs are always case insensitive unless you change the file system from the default non journaled.
0
 

Author Comment

by:orerockon
ID: 39837788
I'll make the corrections in case and send it along to my customer, I hope that resolves the issue for him.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
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…

746 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

13 Experts available now in Live!

Get 1:1 Help Now