wordpress - 在 WordPress 网站上使用共享 SSL

发布于 2024-11-24 00:26:20 字数 1118 浏览 0 评论 0原文

我正在尝试更改 WordPress ecom 插件以通过 ssl 运行结账。我已设法更改插件以使用共享 ssl,但不断收到禁止错误。

以下内容将起作用:(

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Options FollowSymLinks IncludesNoExec ExecCGI

RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^[a-z0-9-_/]+$ mydomainname.co.uk/index.php

#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^index\.php$ - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]

</IfModule>

注释掉其他 WordPress 内容)

我想添加

RewriteCond %{SERVER_PORT} ^80$

只会在端口 80 上触发以下语句,但似乎不起作用...有人有什么想法吗?

** 在职的 **

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
Options FollowSymLinks IncludesNoExec ExecCGI

RewriteCond %{SERVER_PORT} =443
RewriteRule ^[a-z0-9-_/]+$ mydomain.co.uk/index.php [L]

RewriteCond %{SERVER_PORT} =80
RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{SERVER_PORT} =80
RewriteRule . /index.php [L]

</IfModule>

I'm trying to alter a wordpress ecom plugin to to run the checkout over a ssl. I have managed to alter the plugin to use the shared ssl but keep getting forbiden error.

The following will work:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Options FollowSymLinks IncludesNoExec ExecCGI

RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^[a-z0-9-_/]+$ mydomainname.co.uk/index.php

#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^index\.php$ - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]

</IfModule>

(commenting out the other wordpress stuff)

I thought adding

RewriteCond %{SERVER_PORT} ^80$

would only trigger the below statement if on port 80 but doesn't seem to be working... any ideas anyone?

** working **

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
Options FollowSymLinks IncludesNoExec ExecCGI

RewriteCond %{SERVER_PORT} =443
RewriteRule ^[a-z0-9-_/]+$ mydomain.co.uk/index.php [L]

RewriteCond %{SERVER_PORT} =80
RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{SERVER_PORT} =80
RewriteRule . /index.php [L]

</IfModule>

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

盗心人 2024-12-01 00:26:20

尝试在第一个 RewriteRule 之后添加 [L] 限定符。

另外,您确实应该使用

RewriteCond %{SERVER_PORT} =443

而不是正则表达式。

Try adding the [L] qualifier after the first RewriteRule.

Also, you really should use

RewriteCond %{SERVER_PORT} =443

instead of the regex.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文