我正在尝试更改 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>
最佳答案
尝试在第一个 RewriteRule
之后添加 [L]
限定符。
另外,你真的应该使用
RewriteCond %{SERVER_PORT} =443
而不是正则表达式。
关于wordpress - 在 wordpress 站点上使用共享 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6711546/