www重定向到非www,尽管我尝试了一切

发布于 2025-02-13 04:15:52 字数 393 浏览 0 评论 0原文

我正在尝试将域的所有版本重定向使用https:// non-www版本。我在这个论坛上尝试了许多代码,并回答了其他类似问题。我使用WordPress和DirectAdmin并尝试了以下操作:

  • 安装了几个重定向插件,并将默认URL设置为https:// non-www
  • 创建的REGEX规则
  • 在在线启动时添加了一堆代码以下)
  • 使用CloudFlare上的页面规则

似乎没有任何作用。

RewriteEngine On
RewriteCond %{HTTP_HOST} !^salamtavalod.ir$
RewriteRule ^(.*)$ https://salamtavalod.ir/$1 [R=301,L]

I'm trying to redirect all versions of my domain to use https:// non-www version. I've tried many codes on this forum and answers to other similar questions. I use WordPress and DirectAdmin and tried the following:

  • Installed a couple of redirection plugins and set the default url to https://non-www
  • Created Regex rules
  • Added a bunch of codes at the begining of the .htaccess file found online (like the following)
  • Used page rules on CloudFlare

Nothing seems to be working.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^salamtavalod.ir$
RewriteRule ^(.*)$ https://salamtavalod.ir/$1 [R=301,L]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文