WordPress.org

Support

Support » How-To and Troubleshooting » For intranet sites, how to link to a network share?

For intranet sites, how to link to a network share?

  • 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 “http://” 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>

    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 : 'http://' . $link_url;

    Change both to:

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

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

    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).

    Wait, it doesnt work in Firefox.

    but it does work in IE.

    Problem is, I dont really use IE anymore.

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

    Perhaps this will help:

    http://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.
Skip to toolbar