在描述问题之前,我想提前告知您,我已经在搜索有关问题的问题已有几个小时了,但是到目前为止没有任何变化。
现在,由于我的问题,我确实有一个使用SSL的网站,但是人们可以在没有证书的情况下访问它,因此我想对htaccess文件进行更改,以强制所有人使用SSL。
最初我的文件看起来像这样
<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from IP
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Options -Indexes
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
php_flag display_errors Off
php_value max_execution_time 30
php_value max_input_time 60
php_value max_input_vars 1000
php_value memory_limit 128M
php_value post_max_size 9M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
php_value upload_max_filesize 30M
php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
php_flag display_errors Off
php_value max_execution_time 30
php_value max_input_time 60
php_value max_input_vars 1000
php_value memory_limit 128M
php_value post_max_size 9M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
php_value upload_max_filesize 30M
php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
我刚放入]来更改文件>
RewriteEngine On RewriteCond %{HTTPS} !on RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
然后重新上传文件,现在我的网站返回500 Internal Server Error。即使我删除了更改并上传了旧的更改,问题仍然存在。当我决定检查错误日志时,这就是我得到的
[[Fri Dec 27 21:23:26.410830 2019] [core:alert] [pid 29752:tid 47333360273152] [client myIP:28351] /home/root/public_html/.htaccess:
</Files>
没有匹配的<Files>
部分,引荐网址:https://mywebsite.com/非常感谢您的帮助。
在描述问题之前,我想提前告知您,我已经在搜索有关问题的问题已有几个小时了,但是到目前为止没有任何变化。现在,就我的问题而言,我确实有...
前言:我用我的一些评论将其发布为解决方案。