How to style 404 page in WAMP server

前端 未结 5 1602
夕颜
夕颜 2021-01-05 23:05

I am using a WAMP server and I need to change the \"404 not found page\" style using CSS. How can I do it?

\"ent

5条回答
  •  滥情空心
    2021-01-05 23:40

    You can redirect 404 error pages using .htaccess file to your custom pages.

    Design your custom 404 page with using HTML/CSS. Once you have your 404 page setup, all you need to do is send visitors to incorrect url’s to this page. To do this just add the following line to your .htaccess file:

    ErrorDocument 404 /404.php
    

    You can place the 404 error template anywhere you want. For example you could place all error messages in a folder called errormessages

    ErrorDocument 404 /errormessages/404.php 
    

    See this article, How to redirect your 404 error to a custom page

提交回复
热议问题