• Hi,

    I’m using WP to maintain a small website that is accessible from the LAN only.

    I have some PDF files shared on the fileserver (different computer from webserver) and I would like to add new Links to those PDF files.

    On the network, we access the files like “\\fileserver\docs\manual.pdf”

    The problem is, WP always add “https://” before any Link I add and that way, the links dont work!

    Is there a solution for this?

    TIA

Viewing 8 replies - 1 through 8 (of 8 total)
  • Something like this doesn’t work?

    <a href="file:///fileserver/docs/manual.pdf">manual</a>

    Thread Starter iar

    (@iar)

    No, it doesnt ??

    I’m talking about Sidebar Links btw.

    Ah, looks like WP is not so smart on this one. :)

    Edit links-manager.php in the wp-admin/ directory. You’ll find two lines like this:

    $link_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $link_url) ? $link_url : 'https://' . $link_url;

    Change both to:

    $link_url = preg_match('/^(https?|ftps?|mailto|news|gopher|file):/is', $link_url) ? $link_url : 'https://' . $link_url;

    It’s always a good idea to back up source files before editing, and to comment your changes for future reference.

    Thread Starter iar

    (@iar)

    Thanks, it accepts “file://something” now.
    Theres a problem tho (or maybe im just dumb and missing something here) – it doesnt work.

    I mean, the PDF link does not open. I click the link and nothing happens.
    I do have access to the fileserver (windows has memorized the user/password).

    Thread Starter iar

    (@iar)

    Wait, it doesnt work in Firefox.

    but it does work in IE.

    Problem is, I dont really use IE anymore.

    Thread Starter iar

    (@iar)

    So, is there a light at the end of the tunnel?

    Perhaps this will help:

    https://forums.mozillazine.org/viewtopic.php?t=13859

    (Topic is a few years old, but I don’t believe the issue is.)

    you should store the pdf files on the same server as WP.

    this is what I’ve done at work in similar setup, except it’s a l.a.m.p.’d WP

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘For intranet sites, how to link to a network share?’ is closed to new replies.