I know this is an old question, but:
but. Gneid solution works well. However, Windows may require some modification, so DOCUMENT_ROOT will be replaced before the slash is replaced. Otherwise, no replacement will be made, and the $ file will be displayed in the same way as the original path and file name, except that backslashes are canceled.
Since I'm testing in multiple browsers, I modified all the relevant lines in C: \ Users [username] \ AppData \ Roaming \ Notepad ++ \ shortcuts.xml:
<Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command> <Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="70">safari "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command>
Then create the file "redirect.php" in the network root directory as follows:
<?php $root = $_SERVER['DOCUMENT_ROOT']; $file = $_GET['file']; $file = str_replace($root, '', $file); $file = str_replace('\\', '/', $file); header("Location: http://localhost{$file}"); ?>
Jesperai Jun 02 '14 at 2:54 on 2014-06-02 14:54
source share