1

我正在尝试将我的 http 页面设置为 https。我要更改的页面是http://dtesolar.ca/estore

我希望我可以使用 https 而不是 http。我已经购买了 ssl 证书,我正在为 wordpress 使用 HTTPS 插件,但它不起作用,所以我正在考虑使用 .htaccess 文件来完成它,但不确定语法。

这是 htaccess 文件的默认内容:

# 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

请帮忙!

4

1 回答 1

0

让你的 .htaccess 像这样:

# BEGIN WordPress 
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# force HTTPS for store
RewriteCond %{HTTPS} off
RewriteRule ^estore/ https://%{HTTP_HOST}%{REQUEST_URI} [L,NC,R=301]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

PS:您需要在此 https URL 上修复您的 JS、css 和图像的链接。

于 2013-11-05T07:15:56.213 回答