欢迎访问2017年洛阳SEO牛广的官方博客,只要标题有亲测有效的都是原创文章。为大家提供最新真实有效的案例,承接网站SEO百度优化业务QQ:939380096

网站404页面虚拟主机设置方法+JS跳转-亲测有效

SEO niuguang 2405次浏览 43个评论

 为什么要设置404页面

 洛阳SEO牛广认为,可以让网站对用户变的友好,当发生了某些原因导致网页错误时候出现404页面,简单讲就是能让页面起死回生。跳转到首页,对用户进行再一次的展示。让用户再次点击产生转化。

如何设置404页面

 在一般情况下 网站存放位置2个地方.

1 虚拟云 (虚拟主机)。

2  云服务器(独立VPS) 这个又分 Wamp环境和Lamp环境.

在这里站长牛广演示 虚拟云 废话不多说请看下文。

演示材料 

 百度云 虚拟云 404页面设置 (其他的虚拟主机基本都是一样)。

虚拟云 404页面设置

 第一步

首先准备好 自己的404页面 和 图片文件。

  404页面为了方便一般都是把CSS JS HTML 都写在一个 html文件里 方便管理(一般情况下404页面一旦做好是不动的).

  如果你想把css js 进行导入 分类出来也行,这个看个人了。  里面的路径不能错,特别是图片文件路径

404页面

第二步

上传FTP 

        我们把404.html这个页面上传到网站目录, 一般情况是上传到网站跟目录,如果你想放到其他目录也行但是有一点就是要记好路径地址(等下要把地方放在主机控制面板设置里面)。

  本次演示404放在根目录,图片文件要对应好html中写的路径,当你把你的图片上传到FTP自己指定的目录后,可以在阅览器的地址栏访问下路径看看能不能访问到你的图片。

FTP目录

图片路径测试

洛阳SEO牛广404页面图片路径

第三步

修改主机控制面板设置

百度云404控制页面操作

到这里基本上就结束了 我们来测试下。

123.html这个页面是不存在的。

404测试页面

测试成功。

测试页面

 

 下面代码是洛阳SEO牛广网站上的404页面代码 带有js 5秒跳转 js我已经写好了注释, 复制粘贴改下路径就能用。

<html>
<head>
<meta charset="utf-8">
<title>404页面自动跳转</title>
<style>
*{margin:0;padding:0;outline:none;font-family:\5FAE\8F6F\96C5\9ED1,宋体;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;user-select:none;cursor:default;font-weight:lighter;}
.center{margin:0 auto;}
.whole{width:100%;height:100%;line-height:100%;position:fixed;bottom:0;left:0;z-index:-1000;overflow:hidden;}
.whole img{width:100%;height:100%;}
.mask{width:100%;height:100%;position:absolute;top:0;left:0;background:#000;opacity:0.6;filter:alpha(opacity=60);}
.b{width:100%;text-align:center;height:400px;position:absolute;top:50%;margin-top:-230px}.a{width:150px;height:50px;margin-top:30px}.a a{display:block;float:left;width:150px;height:50px;background:#fff;text-align:center;line-height:50px;font-size:18px;border-radius:25px;color:#333}.a a:hover{color:#000;box-shadow:#fff 0 0 20px}
p{color:#fff;margin-top:40px;font-size:24px;}
#num{margin:0 5px;font-weight:bold;}
</style>
<script type="text/javascript">
 var num=6; //定义变量值 设置秒数
 function redirect(){ //创建函数
 num--; //变量减减
 document.getElementById("num").innerHTML=num; //找到div
 if(num==2){ //判断函数值
 window.location.href="http://www.xiaoguangseo.com"; //跳转
 }
 }
 setInterval("redirect()", 1000); //反复调用函数
</script>
</head>

<body onLoad="redirect();">
<div class="whole">
 <img src="http://www.xiaoguangseo.com/wp-includes/images/back.jpg" />
 <div class="mask"></div>
</div>
<div class="b">
 <img src="http://www.xiaoguangseo.com/wp-includes/images/404.png" class="center"/>
 <p>
 暂时未能找到您查找的页面<br>
 可能输入的网址错误或此页面不存在<br>
 <span id="num"></span>秒后自动跳转到主页
 </p>
 </div>

</body>
</html>

小广 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明网站404页面虚拟主机设置方法+JS跳转-亲测有效
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到
(43)个小伙伴在吐槽
  1. I am also writing to let you be aware of of the brilliant experience my cousin's daughter found viewing yuor web blog. She came to find a lot of details, most notably what it is like to possess an ideal giving mindset to let certain people without difficulty know precisely several advanced topics. You really surpassed our own expectations. Many thanks for coming up with those good, healthy, educational and also cool tips on this topic to Ethel. crazy explosive [url=http://www.adidas-crazyexplosive.us.com]crazy explosive[/url]
    匿名2018-06-04 04:44 回复
  2. I enjoy you because of all your hard work on this site. Ellie delights in conducting investigation and it's simple to grasp why. My spouse and i know all of the powerful medium you convey very important tips through this web blog and as well strongly encourage response from other ones on that matter and my child is in fact being taught a lot. Take pleasure in the remaining portion of the new year. You're doing a good job. asics shoes
    匿名2018-06-04 17:28 回复
  3. I'm also commenting to let you know what a awesome discovery my friend's daughter gained visiting your blog. She figured out too many pieces, not to mention how it is like to have an excellent coaching mood to get other individuals without hassle learn about a number of advanced topics. You undoubtedly exceeded visitors' desires. Thanks for coming up with the beneficial, healthy, educational and also cool guidance on this topic to Emily. russell westbrook shoes
    匿名2018-06-05 06:21 回复
  4. I not to mention my friends have already been reading the excellent helpful tips from your web site and then at once got a terrible suspicion I never thanked the web blog owner for those strategies. Those guys happened to be for this reason thrilled to study all of them and now have in reality been taking advantage of them. Appreciate your genuinely simply helpful as well as for going for this form of notable information millions of individuals are really desirous to discover. My personal sincere apologies for not expressing gratitude to you sooner. adidas superstar uk
    匿名2018-06-06 02:46 回复
  5. Thank you a lot for providing individuals with an exceptionally brilliant opportunity to read articles and blog posts from this site. It's always very useful and as well , stuffed with a lot of fun for me personally and my office friends to visit your blog no less than thrice every week to study the newest tips you will have. And lastly, I'm just actually fulfilled considering the spectacular tactics you serve. Certain 4 facts in this posting are in truth the most efficient we've ever had. nfl jerseys
    匿名2018-06-06 14:11 回复
  6. I'm writing to make you be aware of what a terrific experience our princess enjoyed reading through your web site. She came to find many pieces, with the inclusion of what it's like to have a great teaching mindset to let the mediocre ones without problems learn some very confusing subject matter. You undoubtedly did more than my expectations. Thanks for offering these helpful, safe, explanatory and as well as unique tips about the topic to Julie. goyard bags
    匿名2018-06-07 02:59 回复
  7. Oh my goodness! an amazing article dude. Thank you Nonetheless I am experiencing problem with ur rss . Don抰 know why Unable to subscribe to it. Is there anyone getting an identical rss problem? Anyone who is aware of kindly respond. Thnkx
    匿名2018-06-07 08:23 回复
  8. I actually wanted to construct a quick note in order to thank you for the pleasant ideas you are giving out at this site. My incredibly long internet research has at the end of the day been compensated with reasonable know-how to exchange with my friends. I 'd suppose that we site visitors actually are really endowed to exist in a decent place with very many awesome professionals with valuable suggestions. I feel rather happy to have discovered your entire website page and look forward to some more cool times reading here. Thanks once again for a lot of things. adidas nmd
    匿名2018-06-07 15:13 回复
  9. I would like to convey my affection for your kindness for those who really want help on in this question. Your real dedication to passing the solution around appears to be wonderfully practical and have in every case enabled most people like me to realize their goals. Your amazing valuable guide signifies so much to me and further more to my office workers. Thanks a lot; from all of us. supreme clothing
    匿名2018-06-08 04:35 回复
  10. I simply wished to say thanks once again. I'm not certain the things I would have tried without the tips and hints provided by you about such area. This has been the troublesome issue for me personally, however , noticing this well-written style you managed the issue took me to leap over delight. I'm just grateful for the information and as well , trust you find out what a powerful job your are getting into training others through your webpage. Most likely you have never met any of us. jordan shoes
    匿名2018-06-08 17:22 回复
  11. I together with my buddies were found to be reading the best secrets and techniques found on your site and then all of the sudden I got a terrible feeling I had not expressed respect to the web site owner for them. The young boys ended up for that reason glad to read through all of them and already have quite simply been taking advantage of those things. Appreciation for being well thoughtful and also for making a decision on certain outstanding subject areas millions of individuals are really wanting to discover. My very own honest apologies for not expressing gratitude to you earlier. nmd
    匿名2018-06-08 20:55 回复
  12. My husband and i have been excited Raymond managed to round up his preliminary research through the entire ideas he gained while using the web page. It's not at all simplistic to simply choose to be giving for free helpful tips which most people could have been selling. And now we do understand we now have the website owner to be grateful to because of that. Those illustrations you have made, the straightforward site menu, the relationships you assist to foster - it's got many awesome, and it's leading our son in addition to the family do think the subject is pleasurable, and that's rather important. Thank you for all the pieces! tom ford glasses
    匿名2018-06-09 06:49 回复
  13. My husband and i were quite lucky when Ervin could finish off his survey through your precious recommendations he made from your own web page. It is now and again perplexing to simply choose to be freely giving strategies that many some others may have been making money from. We consider we've got the writer to thank for this. The entire illustrations you've made, the simple site menu, the friendships you will make it easier to engender - it's got mostly fantastic, and it is aiding our son in addition to our family reason why the subject is enjoyable, and that is exceedingly mandatory. Thanks for the whole thing! damian lillard shoes
    匿名2018-06-09 22:47 回复
  14. I wanted to compose a message to express gratitude to you for all of the wonderful information you are writing at this website. My particularly long internet lookup has now been paid with reputable details to share with my family. I would assert that many of us readers actually are very much lucky to exist in a good website with so many marvellous people with very helpful tricks. I feel really lucky to have seen your entire web pages and look forward to really more cool minutes reading here. Thanks a lot once more for a lot of things. lebron 15
    匿名2018-06-10 10:12 回复
  15. My wife and i ended up being really glad when Edward managed to deal with his researching from the ideas he discovered when using the blog. It is now and again perplexing to just continually be giving out solutions which most people have been making money from. Therefore we do understand we have the website owner to thank for that. The explanations you've made, the easy website navigation, the relationships you will make it easier to foster - it's everything astonishing, and it's facilitating our son in addition to us do think the issue is thrilling, which is very important. Thank you for everything! longchamp handbags
    匿名2018-06-11 03:32 回复
  16. I and my pals came reading through the good items located on your web blog and so then came up with a horrible suspicion I never expressed respect to you for those techniques. Most of the young boys are already certainly passionate to study all of them and have unquestionably been using those things. Appreciation for turning out to be very accommodating and also for using such awesome themes millions of individuals are really needing to learn about. Our own sincere apologies for not expressing gratitude to earlier. kate spade handbags
    匿名2018-06-11 16:47 回复
  17. Thanks for your own efforts on this website. My mum delights in working on investigations and it's easy to understand why. Many of us learn all concerning the powerful mode you make worthwhile tips through the blog and as well as recommend participation from some others on the topic while our own simple princess has been studying so much. Take pleasure in the remaining portion of the new year. You're performing a glorious job. paul george shoes
    匿名2018-06-12 05:05 回复
  18. I simply desired to thank you so much once more. I'm not certain the things I would've accomplished in the absence of those hints shown by you concerning such area of interest. Entirely was a real frightening situation in my opinion, nevertheless considering a well-written avenue you managed it forced me to weep for happiness. I'm just happier for the work and then pray you comprehend what an amazing job that you're getting into training the rest by way of your blog post. More than likely you have never met any of us. adidas ultra boost
    匿名2018-06-12 11:31 回复
  19. My spouse and i were really glad Albert could complete his inquiry because of the ideas he received from your web pages. It is now and again perplexing to just choose to be releasing methods people today could have been trying to sell. Therefore we know we now have the writer to be grateful to for this. The explanations you have made, the easy site menu, the relationships you make it easier to create - it is all wonderful, and it's aiding our son in addition to us recognize that the situation is thrilling, which is pretty serious. Many thanks for all! oakley sunglasses
    匿名2018-06-12 17:31 回复
  20. I enjoy you because of all your valuable work on this website. Kate really loves working on research and it is simple to grasp why. We learn all about the compelling tactic you deliver insightful ideas on the web site and as well inspire response from people on this theme while our own girl is really being taught so much. Have fun with the remaining portion of the new year. Your carrying out a wonderful job. balenciaga sneakers
    匿名2018-06-13 06:08 回复
  21. I really wanted to construct a quick comment to express gratitude to you for all the nice facts you are showing here. My time consuming internet search has now been paid with pleasant strategies to write about with my family. I would tell you that we visitors are definitely endowed to dwell in a superb website with many perfect individuals with good pointers. I feel extremely privileged to have seen your webpages and look forward to so many more cool times reading here. Thanks once more for a lot of things. vibram five fingers
    匿名2018-06-13 18:11 回复
  22. I must get across my appreciation for your generosity in support of people that require help with this important area. Your personal dedication to getting the solution around was pretty productive and has truly enabled many people just like me to reach their endeavors. Your useful help signifies a whole lot a person like me and somewhat more to my mates. Warm regards; from everyone of us. ray ban aviator sunglasses
    匿名2018-06-14 08:07 回复
  23. Thanks a lot for giving everyone a very brilliant possiblity to read in detail from this website. It's always very awesome and also stuffed with a lot of fun for me personally and my office peers to visit your blog particularly thrice in one week to find out the newest tips you have got. And of course, I'm just certainly astounded with the breathtaking tactics you serve. Selected 2 areas in this post are particularly the most impressive I have had. timberland outlet
    匿名2018-06-15 00:13 回复
  24. I am writing to make you be aware of what a perfect discovery my wife's princess gained studying your webblog. She learned a good number of pieces, which included what it's like to have an incredible giving spirit to make other people with ease fully grasp specified hard to do matters. You actually exceeded visitors' expected results. Many thanks for coming up with these invaluable, trusted, edifying and easy tips on that topic to Evelyn. links of london
    匿名2018-06-15 11:25 回复
  25. Thank you a lot for giving everyone a very marvellous chance to read articles and blog posts from here. It really is very ideal and also packed with a great time for me and my office co-workers to visit your blog on the least thrice in one week to study the new tips you will have. And of course, we're certainly contented with the unique things you serve. Certain 1 areas in this post are certainly the most impressive we have had. kyrie irving shoes
    匿名2018-06-16 02:52 回复
  26. I simply wished to thank you very much once more. I am not sure the things that I would've undertaken without those opinions contributed by you over such a situation. It was a real terrifying scenario in my position, nevertheless considering the specialised manner you processed the issue took me to jump for joy. Now i am thankful for the guidance and as well , expect you comprehend what a powerful job your are putting in teaching other individuals using your web page. Probably you've never got to know all of us. ultra boost 3.0
    匿名2018-06-16 03:58 回复
  27. Thanks so much for providing individuals with an extraordinarily brilliant chance to read articles and blog posts from this blog. It is often very pleasurable and as well , full of a good time for me personally and my office co-workers to search your website at least three times in one week to see the fresh stuff you will have. And of course, I am just always motivated for the great ideas served by you. Some 4 tips in this posting are essentially the most suitable we have had. james harden shoes
    匿名2018-06-16 16:52 回复
  28. I want to express appreciation to the writer for bailing me out of this particular scenario. As a result of checking through the the web and obtaining principles which are not powerful, I believed my entire life was gone. Living without the solutions to the difficulties you've sorted out by means of this report is a critical case, as well as the ones that could have in a negative way damaged my career if I hadn't come across your blog post. That mastery and kindness in maneuvering a lot of stuff was very helpful. I am not sure what I would've done if I hadn't discovered such a stuff like this. It's possible to at this moment look ahead to my future. Thanks a lot very much for your reliable and result oriented guide. I will not think twice to recommend your web sites to any person who needs and wants counselling on this issue. retro jordans
    匿名2018-06-17 06:53 回复
  29. I needed to write you a tiny remark to finally say thanks over again regarding the superb things you have shared at this time. It has been so open-handed with people like you to present unreservedly precisely what some people would've offered for an e book in making some bucks on their own, especially now that you might well have tried it in the event you desired. These basics also acted as the good way to be aware that other individuals have a similar dream really like my very own to see good deal more on the subject of this matter. I am sure there are several more pleasant instances ahead for individuals that see your site. ray ban sunglasses
    匿名2018-06-17 22:02 回复
  30. Thanks so much for giving everyone an exceptionally brilliant possiblity to read from this web site. It really is so amazing and as well , jam-packed with amusement for me and my office acquaintances to visit the blog at the least thrice every week to learn the new tips you have. And lastly, I'm certainly amazed with the spectacular opinions served by you. Selected two ideas in this posting are certainly the most suitable we've had. af1
    匿名2018-06-18 09:35 回复
  31. Thank you for all your valuable hard work on this blog. Kate really loves going through investigations and it's obvious why. My spouse and i know all regarding the compelling ways you create effective strategies through this blog and even increase participation from other individuals on this matter then our simple princess is in fact studying a great deal. Take pleasure in the rest of the new year. You are always carrying out a great job. yeezy shoes
    匿名2018-06-19 12:21 (6天前)回复
  32. I would like to express some appreciation to the writer for rescuing me from this condition. Because of researching throughout the world wide web and seeing principles which are not pleasant, I thought my life was gone. Living devoid of the answers to the problems you have solved as a result of your website is a serious case, and ones that might have in a wrong way affected my career if I had not come across your web page. Your good knowledge and kindness in handling a lot of stuff was vital. I don't know what I would have done if I had not discovered such a thing like this. I can at this time look forward to my future. Thank you very much for this expert and amazing guide. I won't think twice to endorse your blog to any individual who would like support on this topic. adidas ultra boost
    匿名2018-06-19 20:56 (6天前)回复
  33. I wish to point out my respect for your kindness giving support to folks that absolutely need assistance with this one topic. Your special dedication to passing the solution all around appears to be surprisingly good and have usually made individuals like me to achieve their objectives. Your important instruction can mean a lot to me and even further to my fellow workers. Regards; from everyone of us. adidas tubular
    匿名2018-06-20 04:09 (6天前)回复
  34. I not to mention my friends ended up checking out the excellent suggestions found on the website and unexpectedly I had a horrible feeling I never thanked you for those strategies. My people are actually stimulated to read them and now have very much been using these things. Many thanks for being well considerate and then for making a decision on certain important things millions of individuals are really desirous to learn about. Our own sincere regret for not saying thanks to sooner. chrome hearts online
    匿名2018-06-20 18:01 (5天前)回复
  35. I must express some appreciation to you for rescuing me from such a scenario. Because of checking through the the net and finding methods that were not powerful, I believed my entire life was done. Living devoid of the strategies to the difficulties you've solved all through your post is a crucial case, and those which could have adversely damaged my entire career if I had not noticed your blog. Your primary competence and kindness in taking care of every item was tremendous. I don't know what I would've done if I had not come upon such a thing like this. I can also at this time look forward to my future. Thank you very much for the professional and effective help. I will not think twice to suggest your web sites to any individual who requires guidelines on this area. tory burch outlet
    匿名2018-06-21 06:58 (4天前)回复
  36. I wish to voice my appreciation for your kind-heartedness in support of those people that must have assistance with your subject matter. Your special commitment to getting the solution across appears to be extraordinarily interesting and has really made some individuals like me to arrive at their dreams. Your new interesting advice signifies a lot a person like me and further more to my peers. Thank you; from each one of us. links of london outlet store
    匿名2018-06-22 06:11 (3天前)回复
  37. I must voice my admiration for your generosity for women who have the need for guidance on the question. Your real dedication to getting the message along appeared to be rather good and have consistently made women like me to achieve their targets. This useful advice implies much a person like me and somewhat more to my peers. Thanks a lot; from each one of us. michael kors outlet
    匿名2018-06-22 18:58 (3天前)回复
  38. I not to mention my pals were reviewing the best things on the website while immediately I had a terrible feeling I never expressed respect to the site owner for those secrets. These young men became so happy to study all of them and have now actually been loving those things. Many thanks for getting simply helpful and also for settling on such great useful guides millions of individuals are really needing to be aware of. Our own honest apologies for not saying thanks to earlier. nmd uk
    匿名2018-06-23 06:13 (2天前)回复
  39. I intended to put you a tiny remark so as to say thank you the moment again regarding the striking thoughts you've provided on this site. It's certainly surprisingly generous with you to convey unreservedly all that most people could have sold for an electronic book to generate some bucks for themselves, most importantly seeing that you could have tried it in case you decided. Those tactics as well acted to become a good way to be aware that most people have the same interest just like my own to find out a lot more with regards to this condition. I think there are some more fun sessions in the future for folks who browse through your blog post. lebron james shoes
    匿名2018-06-23 07:58 (2天前)回复
  40. I simply had to thank you so much yet again. I am not sure the things I could possibly have tried without the entire recommendations shared by you directly on such a concern. This has been an absolute troublesome difficulty for me personally, but encountering the well-written tactic you processed that made me to jump with gladness. Extremely grateful for this help and even hope that you find out what a great job you happen to be undertaking teaching other individuals via your websites. Probably you haven't met all of us. adidas yeezy boost
    匿名2018-06-23 22:55 (2天前)回复
  41. My wife and i felt really fortunate that John managed to finish up his basic research using the precious recommendations he made out of the web page. It is now and again perplexing to simply find yourself giving out steps which most people could have been trying to sell. And we also recognize we've got you to appreciate for that. All the illustrations you've made, the simple web site menu, the relationships you will help foster - it is all terrific, and it is letting our son in addition to the family consider that that subject is amusing, which is certainly unbelievably vital. Many thanks for the whole lot! cheap jordans
    匿名2018-06-24 09:48 (1天前)回复
  42. I must show my love for your kind-heartedness giving support to people who really want guidance on that concern. Your special commitment to passing the message up and down had become amazingly advantageous and have regularly enabled regular people just like me to attain their objectives. Your amazing helpful guide signifies a great deal a person like me and a whole lot more to my colleagues. With thanks; from each one of us. kobe sneakers
    匿名2018-06-25 01:25 (16小时前)回复
  43. I must point out my love for your kind-heartedness supporting those people who should have help with this important concept. Your very own dedication to passing the message all over came to be amazingly powerful and has consistently permitted workers like me to attain their objectives. Your personal informative hints and tips indicates so much to me and even further to my colleagues. Best wishes; from all of us. jordan 11 retro
    匿名2018-06-25 13:15 (5小时前)回复