修改链接跳转
近期发现页面跳转挺麻烦,打开链接后,显示评论者的网址,然后还需要点击一下才会跳转过去,本意只是隐藏评论者网址,以下是修改后的goto文件的代码,记录一下。
<?php
// Extract and decode the URL from the query parameter
$url = isset($_GET['url']) ? $_GET['url'] : '';
$decoded_url = base64_decode($url);
// Validate the decoded URL to ensure it's a valid URL
if (filter_var($decoded_url, FILTER_VALIDATE_URL)) {
// Perform the redirect
header("Location: $decoded_url");
exit;
} else {
// Fallback if the decoded URL is invalid
echo '<div style="max-width: 600px; width: 100%; margin: 0 auto; position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);">
<main style="margin: 0 auto; max-width: 100%; padding: 0 30px; font-size: 1.3em;">
<div style="color: #6b7280; padding: 0 0 15px; line-height: 2em;">无效的URL,请检查链接。</div>
</main>
</div>';
}
?>
哈哈,会折腾啊。
无聊,瞎改着玩~😄
我之前写过一个js,就是提取评论区所有链接强制给链接前面加上一个网址然后?url=https://xxx.xx 。首先跳到一个出站提示页,后面觉得麻烦又给移除了。
为了避免一些不必要的麻烦,前端隐藏评论者网址,点击后能自动跳转到对应的网站就行。
等会拿走用了,确实每次点开特麻烦
这样就方便些![[耍酷]](https://illl.xyz/wp-content/themes/Simple/img/smilies/icon_cool.png)
有备案搞个跳转提示还是无奈,哪天要是注销了我第一个要撤消的功能就是它。麻烦得很
搬到海外,打开速度就成了重要问题。。