我有一个子域
http://blog.example.com
https://www.example.com/blog
http://blog.example.com/wp-admin
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
RewriteCond %{HTTP:X-Forwarded-Host}i ^example\\.com
RewriteCond %{HTTP_HOST} ^blog\\.example\\.com$
RewriteRule ^/?(.*)$ https://www.example.com/blog/$1 [L,R=301,NC]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*)$ https://www.example.com/blog/$1 [L,R=301,NC]
</IfModule>
我的网站URL和WordPress URL是:WordPress Address (URL) = /blog
Site Address (URL) = https://www.example.com/blog
但这种设置会重定向我网站中的每个URL,并在后端产生许多问题。最好的方法是什么?