我在谷歌云计算引擎中部署了我的wordpress站点。要启用SSL,我遵循此处概述的步骤https://www.onepagezen.com/free-ssl-certificate-wordpress-google-cloud-click-to-deploy
安装Certbot客户端生成证书配置证书启用HTTPS重定向重新启动Apache服务器更新WordPress URL/etc/apache2/sites-available/default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
...
以及/etc/apache2/sites-available/wordpress.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName mydomain.com
ServerAlias mydomain.com
Redirect permanent / https..mydomain.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
设置完所有内容后,我运行:sudo a2ensite default-ssl
sudo a2enmod ssl
sudo service apache2 restart
SSL在后端和登录页上运行良好。然而,对于所有其他页面,我得到了404。当我从自定义永久链接切换到简单永久链接时,页面可以再次访问。你知道是什么导致了这个问题吗?