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.
我需要任何www。仅当子域尚不存在时才自动添加到我的域中。我确实希望子域绕过此重定向。
我怎样才能做到这一点?
要在没有子域时自动将 a 添加www到您的域名中,请将其添加到文档根目录中的 htaccess 文件中:
www
RewriteEngine On RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]