我想請問一下各位大佬,就是我是剛開始步入網站運營,但是有個讓我糾結的問題就是如以下例:http://abc.com/login.html?ref...如何重定向到http://abc.com/login.html 這個全靜態鏈接上呢?謝謝各位大佬了提示:虛擬機禁止使用了server指令
1 回答

守著星空守著你
TA貢獻1799條經驗 獲得超8個贊
不讓用Server指令就基本放棄吧。 最多在 login.html中添加js腳本實現客戶端判斷并跳轉,至于301/302就不能實現了。
<script>if(/\?refer=/ig.test(window.location.href)) { window.location.href = window.location.origin + window.location.pathname; }</script>
- 1 回答
- 0 關注
- 799 瀏覽
添加回答
舉報
0/150
提交
取消