2

我只需要将我的 wordpress 网站中的一页从 http 重定向到 https。我在网上搜索,但似乎没有一个解决方案有效。这是我的 .htaccess 文件中的代码:

# Redirect to force SSL on test page
RewriteCond %{HTTPS} off
RewriteRule ^test/$ https://www.example.com/test/ [R=301,L]

任何建议将不胜感激。

4

3 回答 3

0

有一个插件叫做“页面链接”

它在帖子/页面的底部添加了一个元框,您可以告诉它“指向其他 URL”而不是“指向现有 url”。然后,它会为您提供一个框,可以在其中放置您想要的任何 URL。我想,您可以重定向到 https://,因为我们多年来一直使用它来重定向到许多不同的地方(尽管不是专门的 https 版本的页面)。虽然它是一个免费插件,但我不明白为什么它不起作用

于 2012-10-17T18:19:39.060 回答
0

那这个呢?

RewriteEngine On
RewriteRule ^my-test-page\.html$ https://www.domain.com/my-test-page.html [R=301,L]

干杯。

于 2012-10-17T18:21:05.410 回答
0

编辑.htaccess

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
于 2019-11-12T05:56:47.030 回答