我知道很多人问过类似的问题...wordpress 在根文件夹中。
我已经恢复了 Wordpress 网站中转站主页和 wp-admin 都出现 403 错误。我可以使用访问该网站/wp-admin/index.php
,还可以访问其他一些页面,例如/meet-me/
如果我启用 Wordpressdebug
并尝试打开,/index.php
我会收到大量 php 贬值警告 - 但没有错误。
这是我的虚拟主机配置
<VirtualHost *:80>
ServerName michaeltissington.com
ServerAlias www.michaeltissington.com
DocumentRoot /var/www/michaeltissington.com/html
DirectoryIndex index.php, index.html
<Directory "/var/www/michaeltissington.com/html">
AllowOverride All
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
LogLevel emerg
RewriteEngine on
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=302]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName michaeltissington.com
ServerAlias www.michaeltissington.com
DocumentRoot /var/www/michaeltissington.com/html
DirectoryIndex index.php, index.html
<Directory "/var/www/michaeltissington.com/html">
AllowOverride All
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
LogLevel emerg
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.michaeltissington.com
RewriteRule ^ https://michaeltissington.com%{REQUEST_URI} [END,NE,R=302]
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/michaeltissington.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/michaeltissington.com/privkey.pem
</VirtualHost>
</IfModule>
我已删除并重新创建 .htaccess
# Browser caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType font/woff2 "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/svg+xml "access 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType text/html "access plus 600 seconds"
</IfModule>
# Block User ID Phishing Requests
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} ^author=([0-9]*)
RewriteRule .* https://michaeltissington.com/? [L,R=302]
</IfModule>
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我已通过执行以下操作确保文件权限正确
find -type f -exec chmod 644 {} +
find -type d -exec chmod 755 {} +