我想从此重定向:
http://example.com/admin/index.php?route=common/home&token=e687040d4b0f5f42a4eab8951a3b57b4
对此:
http://www.example.com/admin/index.php?route=common/home&token=e687040d4b0f5f42a4eab8951a3b57b4
我的htaccess:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/%{THE_REQUEST}$1 [R=301,L]
但它重定向我:
http://www.example.com/index.php?route=common/home&token=e687040d4b0f5f42a4eab8951a3b57b4
答案 0 :(得分:0)
使用此:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]