Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to redirect a browser to a file on the local network?

Tags:

php

I'm wondering if it's possible to redirect to a URL like:

\\central\public\blah\test.html

in PHP? We want to put a link on the website for employees to quickly access tools that have to be kept on the local network for security reasons. Basically the link would only work if you were in the office.

I've tried using:

header("location: \\central\public\blah\test.html"); 

but it just formats the URL to http://

like image 836
11 revs, 2 users 95% Avatar asked Dec 30 '25 18:12

11 revs, 2 users 95%


2 Answers

Try enough forward slashes and the file:// protocol:

file://///central/public/blah/test.html

(reference: http://forums.mozillazine.org/viewtopic.php?f=38&t=908015)

like image 74
AKX Avatar answered Jan 02 '26 08:01

AKX


try:

header("location: file://central/public/blah/test.html");

like image 32
Calvin Avatar answered Jan 02 '26 10:01

Calvin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!