Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道他的
RewriteEngine On RewriteCond %{HTTP_HOST} ^yourdomain\.net$ RewriteRule (.*) http://www.yourdomain.net/$1 [R=301,L]
但是,我事先不知道域名是什么(可能是大约 30 个域名之一)。是否可以使 yourdomain.com 变量匹配所有 30 个可能的域?
您真的不需要匹配这 30 个域:
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]