我已经在Wordpress建立了一个商店,但我想包括在我的网站上,而不改变网址。
有人能告诉我为什么下面的方法不起作用吗?
此代码位于.htaccess文件中。
RewriteCond %{HTTP_HOST} ^www.example.com/shop/
RewriteRule ^(.*) https://www.wordpress.com/shop/$1 [P]非常感谢
发布于 2018-06-29 04:39:58
@idm!嗨!尝试将以下2行添加到htaccess文件中:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NC]您的WordPress htaccess文件应如下所示,其中包含上述两行内容:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /shop/
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NC]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule>
# END WordPress此外,请确保相应地调整和保存WordPress地址(网址)和站点地址(网址),以便在WordPress商店仪表板->设置->常规中的url中包含https。
我希望这对你有帮助!
诚挚的问候。
https://stackoverflow.com/questions/51090513
复制相似问题