RewriteEngine On
RewriteCond %{HTTP_HOST} ^jlcustompc.com [NC]
RewriteRule ^(.*)$ https://www.jlcustompc.com/$1 [L,R=301]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^jlcustompc.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.jlcustompc.net$
RewriteRule (.*)$ https://www.jlcustompc.com/$1 [R=301,L]
RedirectMatch 301 /contactform.php /buymypc.php
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
RewriteCond %{HTTP_USER_AGENT} libwww-perl.* [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
RewriteRule ^(.*)$ – [F,L]
我希望 jlcustompc.net 重定向到https://www.jlcustompc.com
这是我唯一遇到的问题。此外,如果您看到任何其他可以添加、替换或修改的内容,请告诉我。
这是我刚刚设置的虚拟主机,似乎没有按预期工作。
我认识的第一个主机毫无疑问是有效的。
<VirtualHost MYIP:443>
ServerAdmin admin@jlcustompc.com
DocumentRoot "ROOT"
ServerName www.jlcustompc.com
ErrorLog ERRORLOG
SSLEngine on
SSLProtocol all
SSLCertificateFile "PATH"
SSLCertificateKeyFile "PATH"
SSLCACertificateFile "PATH"
ServerPath "PATH"
<Directory "PATH">
</Directory>
</VirtualHost>
<VirtualHost MYIP:443>
ServerAdmin admin@jlcustompc.com
DocumentRoot "PATH"
ServerName www.jlcustompc.net
ErrorLog ERRORLOG
SSLEngine on
SSLProtocol all
SSLCertificateFile "PATH"
SSLCertificateKeyFile "PATH"
SSLCACertificateFile "PATH"
ServerPath "PATH"
<Directory "PATH">
</Directory>
</VirtualHost>
<VirtualHost MYIP:80>
ServerAdmin admin@jlcustompc.com
DocumentRoot "PATH"
ServerName www.jlcustompc.net
ErrorLog ERRORLOG
ServerPath "PATH"
<Directory "PATH">
</Directory>
</VirtualHost>
<VirtualHost MYIP:80>
ServerAdmin admin@jlcustompc.com
DocumentRoot "PATH"
ServerName www.jlcustompc.com
ErrorLog ERRORLOG
ServerPath "PATH"
<Directory "PATH">
</Directory>
</VirtualHost>