현재 URL을 새 URL로 리디렉션하여 "ONE 스크립트"를 작성하고 동일한 스크립트의 모든 기존 HTML에 복사 할 수 있습니다. 이전 URL을 책갈피에 추가하고 새 URL로 리디렉션 한 사용자에게 도움이됩니다. 조건부 리디렉션 URL java
내가www.oldsite.com/a1.html
www.oldsite.com/a1/5698.html
www.oldsite.com/x1.html
www.oldsite.com/YY1.html
처럼 오래된 webpeges을하고, 사용자의 현재 URL 및 사용 location.path를 얻을 싶어 경로 (접미사) 012에서 newsite.com 기본 경로로 리디렉션 3,516,
www.newsite.com/ZZ1.html
에 www.newsite.com/99.html
www.oldsite.com/YY1.html
-www.newsite.com/b1/5698.html
www.oldsite.com/x1.html
에
www.oldsite.com/a1.html
www.newsite.com/b1.html
www.oldsite.com/a1/5698.html
에 즉, 나는 여러 번 시도했지만 실패했다!저는 HTML의 새로운 등장 인물이므로 아무도 나를 도울 수 있습니까? 내 사이트는 100 개가 넘는 html을 보유하고 있습니다!
여기
import java.net.URI; URI oldUri;
당신이 오래된에서 새 URI를 생성하여 그 번역 작업을 수행 할 수 있습니다 감안할 때 내 초안
<html> <head> <javascript> if window.location.path='/al.html' { window.location="http://www.newsite.com/b1.html"} else if window.location.path='/al/5698.html' { window.location="http://www.newsite.com/b1/5698.html"} ......... </script> </head>
질문에'java' 태그를 사용하는 이유는 무엇입니까? –
자바 스크립트가 내 질문을 해결할 수 있다고 생각합니다. – user2136039