如何为包含数千个链接的现有网站创建离开网站插页式页面? [英] How can I create an leaving site interstitial page for an existing site with thousands of links?

查看:150
本文介绍了如何为包含数千个链接的现有网站创建离开网站插页式页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,它有许多文件和文件。他们中的大多数都在谷歌驱动器上。我的网站上有超过1000个文件及其链接。

I had a website and it has many documents and files. Most of them are on Google drive. More than 1000 files are there on my website with their links.

我想做

用户点击a链接( https://drive.google.com/file/testxyz )> mywebsite .com / please_wait.html> 5秒后> https://drive.google.com/file/testxyz

User clicks a link (https://drive.google.com/file/testxyz) > goes to mywebsite.com/please_wait.html > after 5 seconds > https://drive.google.com/file/testxyz

所以请帮助我做到这一点(在进入外部网站之前打开一个页面)。由于我的网站有成千上万的链接,因此我(一个人)不可能一个一个手动更改所有链接。所以请提供与java相关的代码。因为我正在使用Weebly,所以不支持php。

So please help me to do this (open a page before going to the external website). As my website had many thousands of links, it is not possible for me (one man) to change all links one by one by hand. So please provide java related code. As I am using Weebly, php is not supported.

推荐答案

创建插页式页面,例如 http://example.com/interstitial.html 。它可以有任何你想要的,但它将需要以下代码:

Create your interstitial page, say http://example.com/interstitial.html. It can have what ever you want on it, but it will need the following code:

setTimeout(function(){
    location.replace(location.search.substr(1));
}, 5000);

您需要在所有文件上执行查找和替换

You will need to do find and replace on all of your files:

查找: https:// drive.google.com

替换: http://example.com/interstitial.html?https://drive.google.com

注意:假设您的网站现在没有querystrings。

Note: this assumes you have no querystrings in your site now.

这篇关于如何为包含数千个链接的现有网站创建离开网站插页式页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆