# 织梦cms会员邮件验证通知在https域名下验证链接404错误的解决方法

*Published:* 2024-01-05
*Author:* 客服001

#### 温馨提醒

如果文章内容或图片资源失效，请留言反馈，我们会及时处理，谢谢

本文最后更新于2024年1月5日，已超过 180天没有更新



程序默认只支持在http://的站点，我们需要改成让[邮件](https://www.xarjtc.com/tag/%e9%82%ae%e4%bb%b6 "查看邮件此标签更多文章")支持http和[https](https://www.xarjtc.com/tag/https "查看https此标签更多文章")均可正常（以下文件如果你的网站里有的的没有，可跳过）

1、打开 /member/index\_do.php 找到，大概在31行

```
$url = 'http://'.preg_replace("#\/\/#i", '/', $url);
```

修改为：

```
$server_port = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
$url = $server_port.preg_replace("/^(http|https):\/\//i", "", trim($url));
```

2、打开 /member/reg\_new.php 找到，大概在250行

```
$url = 'http://'.preg_replace("#\/\/#", '/', $url);
```

修改为：

```
$server_port = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
$url = $server_port.preg_replace("/^(http|https):\/\//i", "", trim($url));
```

3、打开 /member/mail.php 找到，大概在76行

```
$url = 'http://'.eregi_replace('//', '/', $url);
```

修改为：

```
$server_port = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
$url = $server_port.preg_replace("/^(http|https):\/\//i", "", trim($url));
```