项目作者: appson-hosting

项目描述 :
Custom LiteSpeed / cPanel / Apache Error Pages
高级语言:
项目地址: git://github.com/appson-hosting/litespeed-error-pages.git
创建时间: 2017-03-09T04:04:43Z
项目社区:https://github.com/appson-hosting/litespeed-error-pages

开源协议:MIT License

下载


Customise LiteSpeed error pages

Apache / cPanel / LiteSpeed

Create new error folder

  1. mkdir /usr/local/apache/htdocs_error

CD into new folder

  1. cd /usr/local/apache/htdocs_error

Clone repository

  1. git clone https://github.com/joejordanbrown/litespeed-error-pages.git .

To customise the pages fork this repository and make changes and follow steps above but cloning your forked repository.

Including Error Pages

Add the following to your /usr/local/apache/conf/includes/pre_virtualhost_global.conf

  1. Alias /htdocs_error /usr/local/apache/htdocs_error/
  2. ErrorDocument 400 /htdocs_error/400.shtml
  3. ErrorDocument 401 /htdocs_error/401.shtml
  4. ErrorDocument 403 /htdocs_error/403.shtml
  5. ErrorDocument 404 /htdocs_error/404.shtml
  6. ErrorDocument 405 /htdocs_error/405.shtml
  7. ErrorDocument 406 /htdocs_error/406.shtml
  8. ErrorDocument 409 /htdocs_error/409.shtml
  9. ErrorDocument 410 /htdocs_error/410.shtml
  10. ErrorDocument 411 /htdocs_error/411.shtml
  11. ErrorDocument 413 /htdocs_error/413.shtml
  12. ErrorDocument 414 /htdocs_error/414.shtml
  13. ErrorDocument 415 /htdocs_error/415.shtml
  14. ErrorDocument 416 /htdocs_error/416.shtml
  15. ErrorDocument 422 /htdocs_error/422.shtml
  16. ErrorDocument 500 /htdocs_error/500.shtml
  17. ErrorDocument 501 /htdocs_error/501.shtml
  18. ErrorDocument 503 /htdocs_error/503.shtml
  19. ErrorDocument 505 /htdocs_error/505.shtml
  20. ErrorDocument 508 /htdocs_error/508.shtml

On cPanel this can be also found at WHM >> Service Configuration >> Apache Configuration >> Include Editor >> Pre VirtualHost Include >> All Versions

Restart LiteSpeed / Apache


Preview Error Page

Create .htaccess file, replace ***ERROR CODE*** with for example 403

  1. RewriteEngine on
  2. RewriteRule ^error - [L,R=***ERROR CODE***]

Visit http://domain.tld/error to preview error page.