我想在 Ubuntu 上将我的 Apache Webserver 的 404 页面自定义为除一般之外的其他内容:
Not Found
The requested URL /***** was not found on this server.
______________________________________________________
Apache/*.*.** (Ubuntu) Server at **** Port 80
Run Code Online (Sandbox Code Playgroud)
如何做到这一点?
Ami*_* KK 20
我自己找到了答案。
您必须编辑文件 /etc/apache2/conf.d/localized-error-pages
sudoedit /etc/apache2/conf.d/localized-error-pages
Run Code Online (Sandbox Code Playgroud)
您可以输入纯文本或链接到脚本或 html
小智 6
<VirtualHost 192.168.0.1:80>
ServerAdmin admin@host.ru
ServerName host.ru
ServerAlias www.host.ru
DocumentRoot /home/WebServer/www/host.ru/public_html/
ErrorLog /home/WebServer/www/host.ru/logs/error.log
CustomLog /home/WebServer/www/hostu/logs/access.log combined
Alias /error_html/ "/home/WebServer/www/host/error_html/"
<Directory "/home/WebServer/www/host.ru/error_html">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en cs de es fr it nl sv pt-br ro
ForceLanguagePriority Prefer Fallback
</Directory>
ErrorDocument 404 /error_html/HTTP_NOT_FOUND.html
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
41427 次 |
| 最近记录: |