Apache Http Server 2.4+
配置 manifest.webmanifest
mime 类型
您需要配置以下 mime 类型(参见下面的基本配置):
ini
<IfModule mod_mime.c>
# Manifest file
AddType application/manifest+json webmanifest
</IfModule>
基本配置 http 重定向到 https
更新 httpd.conf
配置文件:
ini
# httpd.conf
ServerRoot "<your apache server root>"
Listen 80
ServerName www.yourdomain.com
DocumentRoot "<your document root>"
# modules
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
# mime types
<IfModule mod_mime.c>
# Manifest file
AddType application/manifest+json webmanifest
</IfModule>
# your https configuration
Include conf/extra/https-www.yourdomain.com.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
<VirtualHost www.yourdomain.com:80>
ServerName www.yourdomain.com
RewriteEngine On
# disable TRACE and TRACK methods
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
Options +FollowSymlinks
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://www.yourdomain.com/ [L,R]
ErrorLog logs/www.yourdomain.com-error_log
CustomLog logs/www.yourdomain.com-access_log combined
</VirtualHost>