使用OpenCart我将如何使用 301 重定向添加www.
到域
.htaccess
内容:
#Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine On
#OPENCART REWRITES START
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
#OPENCART REWRITES END
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www\.mysite\.com/$1 [R=301,L]
</IfModule>
请注意,302 重定向正在工作