【发布时间】:2016-01-16 06:14:15
【问题描述】:
假设有人使用此网址访问我的网站:
mywebsite.com/somethingsomething123
我想创建一个新的 url 并把它变成这样:
anotherwebsite.com/somethingsomething123
我怎样才能做到这一点?
任何帮助将不胜感激。
【问题讨论】:
-
尝试使用
location.pathname;例如,var path = location.pathname; var newurl = "anotherwebsite.com" + path;
标签: javascript url url-rewriting