wordpress - 在 WordPress 网站上使用共享 SSL
我正在尝试更改 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在第一个
RewriteRule
之后添加[L]
限定符。另外,您确实应该使用
而不是正则表达式。
Try adding the
[L]
qualifier after the firstRewriteRule
.Also, you really should use
instead of the regex.