我需要将非www URL重定向到多域的WWW URL
这就是我所需要的
http://example.com应转到www.example.com
http://example.de应转到www.example.de
以上所有的地域域名都应该使用www对应其域名(.com .de和.uk在同一服务器上)
发布于 2014-04-28 20:19:19
试试这个:
RewriteEngine On
RewriteCond %{HTTP_POST} !^www\. [NC]
RewriteCond %{HTTP_POST} ^(([^\.]+)\.([a-z\.]+))$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]发布于 2021-02-25 18:58:34
所有的功劳都归功于MrWhite his solution here
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]https://stackoverflow.com/questions/23340012
复制相似问题