强制www和https

时间:2015-03-14 10:38:52

标签: .htaccess

我试图将所有网址重写为https://www。我已经搜索并尝试了各种规则,但没有运气

我希望将example.com/something/something重定向到https://www.example.com/something/something

它是一个wordpress安装。我的.htaccess目前看起来像这样,并没有达到预期的效果。你能帮我解释一下语法吗?

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=302,L]


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

redirect 301 /tulossa-pian /
redirect 301 /vakava-2014 /
redirect 301 /omasivu /
redirect 302 /vakava-2015 /
redirect 302 /vakava-juliste /

0 个答案:

没有答案