0

好的。我很绝望。

基本上,当我在下面添加#Force https 行时,它会将我的发送shop.mydomain.com/wp-adminmydomain.com/wp-adminAaaaaah。

我的 wordpress 商店网站位于主域文件夹内(在另一个 wordpress 网站内),即public_html/mydomain(wordpress install)/shop(wordpress install)

我在 www.mydomain.com (处理一级子域)上安装了通配符 SSL。SSL 部分似乎工作正常。

这是文件夹内的 .htaccess /shop

#Send www to https
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^www.shop.mydomain.com$ [NC]
RewriteRule ^(.*)$ https://shop.mydomain.com/$1 [R=301,L]

#Force Https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN WordPress
etc etc
# END WordPress

在主域文件夹内public_html/mydomain

#.htaccess WildCard SSL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^shop.mydomain.com$
RewriteCond %{REQUEST_URI} !^/shop/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /shop/$1
RewriteCond %{HTTP_HOST} ^shop.mydomain.com$
RewriteRule ^(/)?$ shop/index.php [L]

# BEGIN WordPress
etc etc
# END WordPress

将不胜感激任何建议。=>

4

1 回答 1

1

将以下内容放在域的 .htaccess 中

    # .htaccess WildCard SSL + wordpress + subdomain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^shop.domain.com$
RewriteCond %{REQUEST_URI} !^/shop/
RewriteRule ^(.*)$ /shop/$1
RewriteCond %{HTTP_HOST} ^shop.domain.com$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(/)?$ shop/index.php [L]

# BEGIN WordPress for main domain
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^index\.php$ - [L]
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
于 2014-01-23T14:01:24.090 回答