Title: WP SSL Redirect
Author: Rehmat Alam
Published: <strong>2017 年 5 月 22 日</strong>
Last modified: 2025 年 3 月 5 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/wp-ssl-redirect/assets/icon-256x256.png?rev=1662713)

# WP SSL Redirect

 作者：[Rehmat Alam](https://profiles.wordpress.org/rehmatworks/)

[下载](https://downloads.wordpress.org/plugin/wp-ssl-redirect.1.8.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-ssl-redirect/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-ssl-redirect/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/wp-ssl-redirect/#developers)

 [支持](https://wordpress.org/support/plugin/wp-ssl-redirect/)

## 描述

WP SSL Redirect simply forces the SSL on your WordPress website by applying a 301
redirect from the HTTP path to HTTPS path. Please note that this plugin doesn’t 
install or configure any SSL certificate, instead it simply applies a 301 redirect
to force the SSL on a WordPress website where a valid SSL is already properly installed.

### 1.3

 * Added options to force www or non-www

### 1.3.1

 * A minor bug fix regarding query vars

### 1.3.2

 * Fixed a major bug related to sub-directory installations

### 1.4

 * Rewrote the redirection code to make it even simpler
 * Disabled the website URL update in the database

### 1.5

 * Bug fixes

### 1.6

 * Compatibility test with WordPress 6.1

## 常见问题

### Does this plugin install or configure SSL?

No.

### Does this plugin make any changes to the file system or database?

No changes are made to file system or the database.

### How does WP SSL Redirect perform the redirect?

The plugin makes use of `$_SERVER` array to check either the URL is accessed over
HTTPS or HTTP. If the request is made over HTTP, then the plugin sends a 301 redirect
header and performs the redirect to the HTTPS version of the same URL.

### 301 Redirect is Not Working

If `WP_SITEURL` and `WP_HOME` are hardcoded in your WordPress website’s `wp-config.
php` file, then uncomment or delete these two constants, otherwise WP SSL Redirect’s
301 redirect may not work properly.

## 评价

![](https://secure.gravatar.com/avatar/4196897ec93024a3dab1326dab3d3df5ea61118aa50a4824dfd1251faaed3e49?
s=60&d=retro&r=g)

### 󠀁[Does what it says it does!](https://wordpress.org/support/topic/does-what-it-says-it-does-65/)󠁿

 [unaomnia](https://profiles.wordpress.org/unaomnia/) 2018 年 3 月 22 日

So I was using Really Simple SSL, which is nice because it has more onsite features,
but I NEEDED this plugin to force www to non www and it handles the SSL so, I was
able to deactivate the redirection features of Really Simple SSL and just use WP
SSL Redirect. This was great, because that meant I didn’t have to edit my .htaccess
and risk it being overwritten later by a plugin or by saving the permalinks settings
or something unknown to me.

![](https://secure.gravatar.com/avatar/bfa365f87bd97835707cb8228ee2fcf38f18dad2c05a81c7c5bfee9df298fe3b?
s=60&d=retro&r=g)

### 󠀁[Automatic redirecting issue](https://wordpress.org/support/topic/automatic-redirecting-issue/)󠁿

 [gravietie](https://profiles.wordpress.org/gravietie/) 2017 年 11 月 25 日 1 回复

After I deactivated this plugin I couldn’t use WordPress, I can not sign in again
because it is automatically redirecting to another page that is not related to my
WordPress site, on the other hand I asked the author to help me to remove codes 
or database tables but he did not answer my questions.

![](https://secure.gravatar.com/avatar/4422117a2fd2b9345157ac75f2dc085ba98eb00b4538ad2549b48394805a2124?
s=60&d=retro&r=g)

### 󠀁[Perfect to Force non-WWW 301 Redirects](https://wordpress.org/support/topic/perfect-to-force-non-www-301-redirects/)󠁿

 [crouchback](https://profiles.wordpress.org/crouchback/) 2017 年 10 月 10 日

Exactly what I was looking for: a dead-simple way to force 301 redirects to my non-
www page without having to edit my .htaccess file myself. Nice work.

![](https://secure.gravatar.com/avatar/c7f1918e7dda74e774642451ea333853df7fe1230353db7286b7c89aa6073832?
s=60&d=retro&r=g)

### 󠀁[Worked for me.](https://wordpress.org/support/topic/worked-for-me-59/)󠁿

 [Sohail Ahmed](https://profiles.wordpress.org/meetsohail/) 2017 年 9 月 29 日

The best one, what i was looking for.

![](https://secure.gravatar.com/avatar/aad1befde5f64c4e35e0854c4f7be4f611c3e6fa058cf9d51403ffb4cb7abf55?
s=60&d=retro&r=g)

### 󠀁[Works perfectly](https://wordpress.org/support/topic/works-perfectly-1166/)󠁿

 [johnny58](https://profiles.wordpress.org/johnny58/) 2017 年 5 月 23 日

I was struggling to apply the redirect using htaccess file and WP SSL Redirect saved
my day. Thanks for the devs’ efforts.

 [ 阅读所有5条评价 ](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/)

## 贡献者及开发者

「WP SSL Redirect」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Rehmat Alam ](https://profiles.wordpress.org/rehmatworks/)

[帮助将「WP SSL Redirect」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-ssl-redirect)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-ssl-redirect/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/wp-ssl-redirect/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-ssl-redirect/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-ssl-redirect/)。

## 额外信息

 *  版本 **1.8**
 *  最后更新：**1 年前**
 *  活跃安装数量 **700+**
 *  WordPress 版本 ** 5.5 或更高版本 **
 *  已测试的最高版本为 **6.7.5**
 *  PHP 版本 ** 7.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-ssl-redirect/)
 * 标签
 * [301](https://cn.wordpress.org/plugins/tags/301/)[force](https://cn.wordpress.org/plugins/tags/force/)
   [https](https://cn.wordpress.org/plugins/tags/https/)[redirect](https://cn.wordpress.org/plugins/tags/redirect/)
   [ssl](https://cn.wordpress.org/plugins/tags/ssl/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-ssl-redirect/advanced/)

## 评级

 4.2 星（最高 5 星）。

 *  [  4 条 5 星评价     ](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/?filter=2)
 *  [  1 条 1 星评价     ](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-ssl-redirect/reviews/)

## 贡献者

 *   [ Rehmat Alam ](https://profiles.wordpress.org/rehmatworks/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-ssl-redirect/)