Skip to main content
March 8, 2017
Question

Correct hyperlinks try to point to internal folder

  • March 8, 2017
  • 2 replies
  • 841 views

First off, I am using an older version (CS5) at the moment, but this issue has only come up recently.

I am coding emails, so all of my links are external, and my HTML files are standalone, and not part of a site. Therefore, I never use relative links, and the full URL is always in my code.

The problem:

My links come from an excel spreadsheet. I will copy and paste them into my Dreamweaver file, and the link will look correct (for example: <a href="https://www.mysite.com/offerid123" target="_blank">....</a>)

When I view the file in a browser or email proof, clicking the link will direct me to "file:///Users/username/Documents/2017/March/Campaign/filename/https://www.mysite.com/offerid123.html" instead of the URL.

There is nothing wrong with my a tag, nothing visibly different from the links that work and the links that do not. I have tried pasting my URL into TextEdit and then copying and pasting it into my code, which does not work. I have removed the hyperlinks from the excel files so that the cell contains only the text of the URL, and then copying and pasting it into my code, which does not work. The only thing that seems to work is pasting it into my address bar in Chrome, and then copying it back out and pasting it over every instance in my HTML file in Dreamweaver.

I do not know if this is an issue with dreamweaver or the excel files that I am receiving, but I am hoping that I can get some help.

Thanks!

This topic has been closed for replies.

2 replies

Nancy OShea
Community Expert
Community Expert
March 8, 2017

Are you working within a defined local site folder in DW?

Nancy

Nancy O'Shea— Product User & Community Expert
March 9, 2017

No, they are all (and have been) standalone HTML files for each email. So, for example, the only structure would be in my folders. A campaign folder that includes an image folder and the HTML file.

I do not intentionally point to ANYTHING local for links, and the URL will appear to be a complete URL pointing to a site, beginning with http (or https, but you get the idea).

So for example, I will have a link, say, a shopping site. The text of the merchant name will be hyperlinked, and the tag will be, for example:

<a href="http://www.merchantname.com" target="_blank">Super Cool Sale</a>

The URL will have been copied from a spreadsheet and pasted into place in each individual "a" tag, or pasted using Find and Replace. Now, when I open the file to test my links, clicking the hyperlinked text will throw a 404, and the address bar will say, "file:///Users/username/Documents/2017/March/Campaign/filename/http://merchantname.com".

The "fix" has been to simply copy, from the URL bar, the very end of it that includes the actual URL that I want, and paste it over the identical text in my HTML... so yes, it is pasting the exact same thing over my existing code, but now it will work.

So the mystery is why, if my code is:

<a href="http://www.merchantname.com" target="_blank">Super Cool Sale</a>

does clicking on the "Super Cool Sale" text try to link to a local file path that doesn't exist?

Nothing has changed about the way that I code, but I recently updated MS Office. I am assuming the issue stems from Excel, but I've been unable to narrow it down there, either. I'm unsure of why I can't just strip out whatever issue is happening by pasting these URLs from Excel into a text editor and THEN putting them into my code.

This also is not a consistent issue that happens with every URL, but it's impossible to figure out by looking at the code. It only comes out in testing.

Thanks!

Ussnorway7605025
Legend
March 9, 2017

sjx7890  wrote

Nothing has changed about the way that I code, but I recently updated MS Office. I am assuming the issue stems from Excel, but I've been unable to narrow it down there, either. I'm unsure of why I can't just strip out whatever issue is happening by pasting these URLs from Excel into a text editor and THEN putting them into my code.

test; if you copy the code from Excel into notepad (some other basic text software) and then into Dreamwaver does that remove the hidden codes?

Jon Fritz
Community Expert
Community Expert
March 8, 2017

Sounds like you're modifying a file in DW without having a Site Definition chosen from the dropdown menu in the Files window.

Those "file" paths are generally absolute paths to locations on your local machine's hard drive and will only work for that particular machine. Once you leave your development computer, the links will stop working because the same files don't exist at the same path on remote machines. DW is putting them in because it doesn't know any other way to allow you to work with files/links on your machine until you define a site.

Even if you're only creating html emails, DW still wants a site defined in order to manage your links correctly. Personally I create an html email site for any given client, work with local versions of all of the files involved, then as a final step before uploading to an email service, add in the absolute path to the remote files with a Find & Replace.

March 9, 2017

I don't have a site defined, but I haven't had to for years... it only recently stopped working.

Just in case I'm not being clear, I'm not putting the "file/" links into my code. I'm putting the full URL to an external site, starting with "http". For some reason, when copied from certain spreadsheets (and I haven't narrowed down why), clicking the link in my file when previewing the file in my browser (or anywhere else) will sometimes point to "file/.... /http://whatever_the_link..." and throws a 404, even on my own machine.

It's almost as if there is some sort of hidden markup that isn't even showing in my HTML, which is causing the link to behave incorrectly, that I can only get rid of by pasting it into my address bar, and then copying it again from there.... as you can imagine that is extremely tedious to do for every link, and when pasting it back into the code over the incorrect link, nothing changes in the code, but suddenly it works.