putradnata

Make Custom 404, 400, and etc. Page

Sep 27th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. Paste this code, and save as ".htaccess" in your web folder.
  2.  
  3. example : C:/xampp/htdocs/your_web/.htaccess
  4.  
  5. # page not available ( 404 not found )
  6. ErrorDocument 404 /path/to/404.php
  7.  
  8. # bad syntax
  9. ErrorDocument 400 /path/to/400.php
  10.  
  11. # unautorized
  12. ErrorDocument 401 /path/to/401.php
  13.  
  14. # not used
  15. ErrorDocument 402 /path/to/402.php
  16.  
  17. # forbiden
  18. ErrorDocument 403 /path/to/403.php
  19.  
  20. # internal server error
  21. ErrorDocument 500 /path/to/500.php
  22.  
  23. # not implemented
  24. ErrorDocument 501 /path/to/501.php
  25.  
  26. # overload
  27. ErrorDocument 502 /path/to/502.php
  28.  
  29. # gateway timeout
  30. ErrorDocument 503 /path/to/503.php
  31.  
  32. and make sure, you have the custom page, must named with the error name, like above.
Advertisement
Add Comment
Please, Sign In to add comment