我想将http://nyarfadent.hu重定向到https://www.nyarfadent.hu 在Chrome中显示结果:
Not Found
The requested URL /https://nyarfadent.hu/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
我的.htaccess
文件:
#rewrite http://nyarfadent.hu
RewriteCond %{HTTP_HOST} ^nyarfadent\.hu$ [OR]
RewriteCond %{HTTP_HOST} ^www\.nyarfadent\.hu$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/.+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^www\.nyarfadent\.hu$ "https\:\/\/www\.nyarfadent\.hu\/" [R=301,L]
# Redirect non-www to www
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>