[英]Using regex to redirect old domain to new while maintaining paths, but not redirecting if specific path in url exists
[英]Redirect links from old to new domain as I browse?
所以我的用例是這樣的-
我們曾經使用舊域名訪問JIRA網站:
https://domain1/browse/TKT-12100
現在,該域已移至:
https://domain2/browse/TKT-12100
但是我的瀏覽器歷史記錄包含與domain1的所有鏈接。 我通常會在瀏覽器的“ URL”標簽中輸入一些關鍵字,然后自動完成並輸入。 現在,我要用domain2動態替換domain1,以便我的JIRA票證可以正常加載。 我討厭這里的手動步驟。
我正在Greasemonkey腳本行上尋找某些東西來實現這一目標,但也歡迎使用任何其他方法。
在這里,它最終如何為我工作。 如果服務器未通電,顯然油脂猴子腳本無法正常工作。 所以首先我將/ etc / hosts文件更改為-
IPOfDomain2 domain1 domain2
發布此更改GM腳本可以正常工作-https: //gist.github.com/aniket91/464ed8f61ecdeec7cf99ae65ea6514c9
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.