Apache mod_rewrite更改当前文件夹的链接

时间:2018-06-20 07:08:21

标签: html apache

我正在使用Apache mod_rewrite代替localhost / test / result /加载localhost / test / action.php。 它很好地加载了localhost / test / action.php,但是即使action.php位于localhost / test /中,当前文件夹的路径也变为localhost / test / result /。

这就是我在php文件中写的链接位于localhost / test / js中的javascript的内容。

<script src="js/order.js"> </script>
<script src="js/jquery-3.3.1.js"></script>
<script src="js/jquery-ui.js"></script>

但是由于当前文件夹路径为localhost / test / result /(通过localhost / test / result /访问时),因此它变为不存在的localhost / test / result / js / order.js。有没有办法让我不必这样写?

<script src="/test/js/order.js"> </script>
<script src="/test/js/jquery-3.3.1.js"></script>
<script src="/test/js/jquery-ui.js"></script>

谢谢

0 个答案:

没有答案
相关问题