换域名301方案 – 来自hostloc大佬

2021-04-30 779 0

const destinationURL = "https://example.com"const statusCode = 301
async function handleRequest(request) {  return Response.redirect(destinationURL, statusCode)}
addEventListener("fetch", async event => {  event.respondWith(handleRequest(event.request))})
server {
    listen 80;
    listen 443 ssl;
    server_name www.old-name.com;
    return 301 $scheme://www.new-name.com$request_uri;
}

https://hostloc.com/forum.php?mod=redirect&goto=findpost&ptid=837904&pid=10293928

相关文章

快速配置反代
复活几万块买的斐讯R1
docker 下操作 mysql
解决服务器安装宝塔面板后, mysql状态页为空, 性能调整无法设置.
macOS 突然无法播放音视频了
homebrew 报错: homebrew-core is a shallow clone.