For intranet sites, how to link to a network share? (9 posts)

  1. IAR
    Posted 11 years ago #


    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?


  2. Kafkaesqui

    Posted 11 years ago #

    Something like this doesn't work?

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

  3. IAR
    Posted 11 years ago #

    No, it doesnt :(

    I'm talking about Sidebar Links btw.

  4. Kafkaesqui

    Posted 11 years ago #

    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.

  5. IAR
    Posted 11 years ago #

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

  6. IAR
    Posted 11 years ago #

    Wait, it doesnt work in Firefox.

    but it does work in IE.

    Problem is, I dont really use IE anymore.

  7. IAR
    Posted 11 years ago #

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

  8. Kafkaesqui

    Posted 11 years ago #

    Perhaps this will help:


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

  9. m4c3w4n
    Posted 10 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic