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.example.com 或 www.example.com/blah/blah 的 URL 自动转发/转向/转换(无论正确的术语是什么)到 example.com 或 example.com/blah/blah?我基本上想将 www 子域中的任何内容推送到包括路径(如果有的话)的域。
在你的 htaccess 文件中使用这个
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]