最新消息:20210917 已从crifan.com换到crifan.org

【已解决】如何实现html页面打开后自动重定向到别处

HTML crifan 831浏览 0评论
折腾:
【未解决】把特定的gitbook发布后时不保存到book.crifan.com
期间,需要去实现,打开一个html页面,比如index.html,自动跳转到别处
即自动重定向
目前是:
https://book.crifan.com/books/scientific_network_summary/website/
显示404找不到
希望加个HTML,比如index.html,自动重定向到:
html auto redirect
Auto-redirect to another HTML page – Stack Overflow
<head>
  <meta http-equiv='refresh' content='0; URL=http://example.com/'>
</head>
去试试
Redirect from an HTML page – Stack Overflow
<html>
  <head>
    <meta http-equiv='refresh' content='0; URL=https://crifan.github.io/scientific_network_summary/website/'>
  </head>
</html>
去上传上去:
[xx@x scientific_network_summary]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring index.html...
Transferring index.html, errors 3...
  100%     143 bytes  143 bytes/sec 00:00:01       6 Errors  


[x@x scientific_network_summary]# ll
total 4
-rw-r--r-- 1 root root 143 Jul 22 22:47 index.html
[root@crifan scientific_network_summary]# cat index.html 
<html>
  <head>
    <meta http-equiv='refresh' content='0; URL=https://crifan.github.io/scientific_network_summary/website/'>
  </head>
结果:
https://book.crifan.com/books/scientific_network_summary/website/
无法自动跳转。。。
输入:
https://book.crifan.com/books/scientific_network_summary/website/index.html
更不对。
搞错了,是要加到 website子目录。。。
去改为:
[xx@crifan scientific_network_summary]# mkdir website
[x@crifan scientific_network_summary]# mv index.html website/
[x@crifan scientific_network_summary]# ll
total 4
drwxr-xr-x 2 root root 4096 Jul 22 22:51 website
[x@crifan scientific_network_summary]# cd website/
[x@crifan website]# ll
total 4
-rw-r--r-- 1 root root 143 Jul 22 22:47 index.html
结果:
-》
可以自动跳转:
如此,即可。
【总结】
此处是给:
https://book.crifan.com/books/scientific_network_summary/website/
下面放了个:
index.html
<html>
  <head>
    <meta http-equiv='refresh' content='0; URL=https://crifan.github.io/scientific_network_summary/website/'>
  </head>
</html>
就可以实现:
当打开:
https://book.crifan.com/books/scientific_network_summary/website/
自动跳转到:
https://crifan.github.io/scientific_network_summary/website/
了。

转载请注明:在路上 » 【已解决】如何实现html页面打开后自动重定向到别处

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 0.717 seconds, using 20.24MB memory