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

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

Share

小 虾

哦也,我是小虾

You may also like...