开发者

wordpress - using shared SSL on wordpress site

开发者 https://www.devze.com 2023-03-20 10:35 出处:网络
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.

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 %{开发者_如何学JAVASERVER_PORT} =80
RewriteRule ^index\.php$ - [L]

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

</IfModule>


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

Also, you really should use

RewriteCond %{SERVER_PORT} =443

instead of the regex.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号